Ignore:
Timestamp:
2010-07-24T23:26:33Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
42acba1
Parents:
f1f7b5e
Message:

MSN supports having people in multiple groups and BitlBee does not. When
moving people between groups, make sure they *are* removed from their old
group.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn_util.c

    rf1f7b5e r8b01217  
    109109}
    110110
    111 int msn_buddy_list_remove( struct im_connection *ic, char *list, char *who )
     111int msn_buddy_list_remove( struct im_connection *ic, char *list, const char *who, const char *group )
    112112{
    113113        struct msn_data *md = ic->proto_data;
    114         char buf[1024];
    115        
    116         g_snprintf( buf, sizeof( buf ), "REM %d %s %s\r\n", ++md->trId, list, who );
     114        char buf[1024], groupid[8];
     115       
     116        *groupid = '\0';
     117        if( group )
     118        {
     119                int i;
     120                for( i = 0; i < md->groupcount; i ++ )
     121                        if( g_strcasecmp( md->grouplist[i], group ) == 0 )
     122                        {
     123                                g_snprintf( groupid, sizeof( groupid ), " %d", i );
     124                                break;
     125                        }
     126        }
     127       
     128        g_snprintf( buf, sizeof( buf ), "REM %d %s %s%s\r\n", ++md->trId, list, who, groupid );
    117129        if( msn_write( ic, buf, strlen( buf ) ) )
    118130                return( 1 );
Note: See TracChangeset for help on using the changeset viewer.