Changes in / [3709301:83e2d30]


Ignore:
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    r3709301 r83e2d30  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2010 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2006 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    2929#include "commands.h"
    3030#ifndef _WIN32
    31 #include <sys/uio.h>
    3231#include <sys/un.h>
    3332#endif
  • ipc.h

    r3709301 r83e2d30  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2010 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2004 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    2626#define BITLBEE_CORE
    2727#include "bitlbee.h"
     28#include <sys/uio.h>
    2829
    2930
  • irc_channel.c

    r3709301 r83e2d30  
    549549        icc->type = IRC_CC_TYPE_DEFAULT;
    550550       
     551        if( bee_group_by_name( ic->irc->b, ic->name + 1, FALSE ) )
     552        {
     553                set_setstr( &ic->set, "group", ic->name + 1 );
     554                set_setstr( &ic->set, "fill_by", "group" );
     555        }
     556        else if( set_setstr( &ic->set, "protocol", ic->name + 1 ) )
     557        {
     558                set_setstr( &ic->set, "fill_by", "protocol" );
     559        }
     560        else if( set_setstr( &ic->set, "account", ic->name + 1 ) )
     561        {
     562                set_setstr( &ic->set, "fill_by", "account" );
     563        }
     564        else
     565        {
     566                bee_irc_channel_update( ic->irc, ic, NULL );
     567        }
     568       
    551569        return TRUE;
    552570}
  • irc_commands.c

    r3709301 r83e2d30  
    141141               
    142142                if( ( ic = irc_channel_by_name( irc, s ) ) == NULL )
    143                 {
    144143                        ic = irc_channel_new( irc, s );
    145                        
    146                         if( strcmp( set_getstr( &ic->set, "type" ), "control" ) != 0 )
    147                         {
    148                                 /* Autoconfiguration is for control channels only ATM. */
    149                         }
    150                         else if( bee_group_by_name( ic->irc->b, ic->name + 1, FALSE ) )
    151                         {
    152                                 set_setstr( &ic->set, "group", ic->name + 1 );
    153                                 set_setstr( &ic->set, "fill_by", "group" );
    154                         }
    155                         else if( set_setstr( &ic->set, "protocol", ic->name + 1 ) )
    156                         {
    157                                 set_setstr( &ic->set, "fill_by", "protocol" );
    158                         }
    159                         else if( set_setstr( &ic->set, "account", ic->name + 1 ) )
    160                         {
    161                                 set_setstr( &ic->set, "fill_by", "account" );
    162                         }
    163                         else
    164                         {
    165                                 bee_irc_channel_update( ic->irc, ic, NULL );
    166                         }
    167                 }
    168144               
    169145                if( ic == NULL )
     
    226202                irc_send_num( irc, 403, "%s :No such channel", cmd[1] );
    227203        }
    228         else if( irc_channel_del_user( ic, irc->user, IRC_CDU_PART, cmd[2] ) )
     204        else if( irc_channel_del_user( ic, irc->user, FALSE, cmd[2] ) )
    229205        {
    230206                if( ic->f->part )
  • irc_im.c

    r3709301 r83e2d30  
    451451        irc_channel_t *ic = c->ui_data;
    452452       
    453         if( ic == NULL )
    454                 return FALSE;
    455        
    456453        if( ic->flags & IRC_CHANNEL_JOINED )
    457454                irc_channel_printf( ic, "Cleaning up channel, bye!" );
     
    466463{
    467464        irc_channel_t *ic = c->ui_data;
    468        
    469         if( ic == NULL )
    470                 return FALSE;
    471465       
    472466        irc_channel_printf( ic, "%s", text );
     
    482476        char *ts = NULL;
    483477       
    484         if( ic == NULL )
    485                 return FALSE;
    486        
    487478        if( sent_at > 0 && set_getbool( &bee->set, "display_timestamps" ) )
    488479                ts = irc_format_timestamp( irc, sent_at );
     
    497488{
    498489        irc_t *irc = bee->ui_data;
    499         irc_channel_t *ic = c->ui_data;
    500        
    501         if( ic == NULL )
    502                 return FALSE;
    503        
    504         irc_channel_add_user( ic, bu == bee->user ? irc->user : bu->ui_data );
     490       
     491        irc_channel_add_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data );
    505492       
    506493        return TRUE;
     
    510497{
    511498        irc_t *irc = bee->ui_data;
    512         irc_channel_t *ic = c->ui_data;
    513        
    514         if( ic == NULL )
    515                 return FALSE;
    516499       
    517500        /* TODO: Possible bug here: If a module removes $user here instead of just
    518501           using imcb_chat_free() and the channel was IRC_CHANNEL_TEMP, we get into
    519502           a broken state around here. */
    520         irc_channel_del_user( ic, bu == bee->user ? irc->user : bu->ui_data, IRC_CDU_PART, NULL );
     503        irc_channel_del_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data, IRC_CDU_PART, NULL );
    521504       
    522505        return TRUE;
     
    525508static gboolean bee_irc_chat_topic( bee_t *bee, struct groupchat *c, const char *new, bee_user_t *bu )
    526509{
    527         irc_channel_t *ic = c->ui_data;
    528510        irc_t *irc = bee->ui_data;
    529511        irc_user_t *iu;
    530        
    531         if( ic == NULL )
    532                 return FALSE;
    533512       
    534513        if( bu == NULL )
     
    539518                iu = bu->ui_data;
    540519       
    541         irc_channel_set_topic( ic, new, iu );
     520        irc_channel_set_topic( c->ui_data, new, iu );
    542521       
    543522        return TRUE;
     
    549528        irc_channel_t *ic = c->ui_data, *oic;
    550529        char stripped[MAX_NICK_LENGTH+1], *full_name;
    551        
    552         if( ic == NULL )
    553                 return FALSE;
    554530       
    555531        /* Don't rename a channel if the user's in it already. */
     
    810786static gboolean bee_irc_channel_free( irc_channel_t *ic )
    811787{
    812         struct groupchat *c = ic->data;
    813        
    814788        set_del( &ic->set, "account" );
    815789        set_del( &ic->set, "chat_type" );
     
    819793       
    820794        ic->flags &= ~IRC_CHANNEL_TEMP;
    821        
    822         /* That one still points at this channel. Don't. */
    823         if( c )
    824                 c->ui_data = NULL;
    825795       
    826796        return TRUE;
Note: See TracChangeset for help on using the changeset viewer.