Changeset eabc9d2


Ignore:
Timestamp:
2010-04-11T22:49:32Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6c56f42
Parents:
d986463
Message:

Fixed cleanup issues when turning off an account. Also fixed syntax of
*_user_free().

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    rd986463 reabc9d2  
    210210       
    211211        while( irc->users )
    212         {
    213                 irc_user_t *iu = irc->users->data;
    214                 irc_user_free( irc, iu->nick );
    215         }
     212                irc_user_free( irc, (irc_user_t *) irc->users->data );
    216213       
    217214        while( irc->channels )
  • irc.h

    rd986463 reabc9d2  
    204204/* irc_user.c */
    205205irc_user_t *irc_user_new( irc_t *irc, const char *nick );
    206 int irc_user_free( irc_t *irc, const char *nick );
     206int irc_user_free( irc_t *irc, irc_user_t *iu );
    207207irc_user_t *irc_user_by_name( irc_t *irc, const char *nick );
    208208int irc_user_set_nick( irc_user_t *iu, const char *new );
  • irc_im.c

    rd986463 reabc9d2  
    7474static gboolean bee_irc_user_free( bee_t *bee, bee_user_t *bu )
    7575{
    76         return irc_user_free( bee->ui_data, bu->ui_data );
     76        return irc_user_free( bee->ui_data, (irc_user_t *) bu->ui_data );
    7777}
    7878
  • irc_user.c

    rd986463 reabc9d2  
    4747}
    4848
    49 int irc_user_free( irc_t *irc, const char *nick )
     49int irc_user_free( irc_t *irc, irc_user_t *iu )
    5050{
    51         irc_user_t *iu;
    5251        GSList *l;
    5352       
    54         if( !( iu = irc_user_by_name( irc, nick ) ) )
     53        if( !iu )
    5554                return 0;
    5655       
  • protocols/bee.h

    rd986463 reabc9d2  
    8585/* bee_user.c */
    8686bee_user_t *bee_user_new( bee_t *bee, struct im_connection *ic, const char *handle );
    87 int bee_user_free( bee_t *bee, struct im_connection *ic, const char *handle );
     87int bee_user_free( bee_t *bee, bee_user_t *bu );
    8888bee_user_t *bee_user_by_handle( bee_t *bee, struct im_connection *ic, const char *handle );
    8989int bee_user_msg( bee_t *bee, bee_user_t *bu, const char *msg, int flags );
  • protocols/bee_user.c

    rd986463 reabc9d2  
    4646}
    4747
    48 int bee_user_free( bee_t *bee, struct im_connection *ic, const char *handle )
     48int bee_user_free( bee_t *bee, bee_user_t *bu )
    4949{
    50         bee_user_t *bu;
    51        
    52         if( ( bu = bee_user_by_handle( bee, ic, handle ) ) == NULL )
     50        if( !bu )
    5351                return 0;
    5452       
  • protocols/nogaim.c

    rd986463 reabc9d2  
    327327        ic->away = NULL;
    328328       
    329         for( l = bee->users; l; l = l->next )
     329        for( l = bee->users; l; )
    330330        {
    331331                bee_user_t *bu = l->data;
     332                GSList *next = l->next;
    332333               
    333334                if( bu->ic == ic )
    334                         bee_user_free( bee, ic, bu->handle );
     335                        bee_user_free( bee, bu );
     336               
     337                l = next;
    335338        }
    336339       
     
    403406void imcb_remove_buddy( struct im_connection *ic, const char *handle, char *group )
    404407{
    405         bee_user_free( ic->bee, ic, handle );
     408        bee_user_free( ic->bee, bee_user_by_handle( ic->bee, ic, handle ) );
    406409}
    407410
  • root_commands.c

    rd986463 reabc9d2  
    633633        bu->ic->acc->prpl->remove_buddy( bu->ic, bu->handle, NULL );
    634634        nick_del( bu->ic->acc, bu->handle );
    635         irc_user_free( irc, cmd[1] );
     635        //TODO(wilmer): bee_user_free() and/or let the IM mod do it? irc_user_free( irc, cmd[1] );
    636636       
    637637        irc_usermsg( irc, "Buddy `%s' (nick %s) removed from contact list", s, cmd[1] );
Note: See TracChangeset for help on using the changeset viewer.