Changeset f0cb961 for protocols/msn


Ignore:
Timestamp:
2007-04-19T06:03:43Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d323394c
Parents:
33dc261
Message:

More API changes: buddy list management. imcb_add_buddy() is now a *real*
callback, it's only called from inside IM-modules. This makes sure a buddy
only gets added to the BitlBee structures if the add was successful. This
gets rid of the weirdness described in #55. Unfortunately for now this
change breaks A) automatic renaming of ICQ contacts (if there are names
stored in the contact list) B) add -tmp.

Location:
protocols/msn
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn_util.c

    r33dc261 rf0cb961  
    9494        msn_buddy_list_add( bla->ic, "AL", bla->handle, bla->realname );
    9595       
    96         if( find_buddy( bla->ic, bla->handle ) == NULL )
     96        if( imcb_find_buddy( bla->ic, bla->handle ) == NULL )
    9797                imcb_ask_add( bla->ic, bla->handle, NULL );
    9898       
  • protocols/msn/ns.c

    r33dc261 rf0cb961  
    305305                        int num;
    306306                       
    307                         if( cmd[4] != NULL && sscanf( cmd[4], "%d", &num ) == 1 )
     307                        if( cmd[4] != NULL && sscanf( cmd[4], "%d", &num ) == 1 && num < md->groupcount )
    308308                                group = md->grouplist[num];
    309309                       
    310                         add_buddy( ic, group, cmd[1], cmd[2] );
     310                        imcb_add_buddy( ic, cmd[1], group );
     311                        imcb_rename_buddy( ic, cmd[1], cmd[2] );
    311312                }
    312313                if( list & 2 ) /* AL */
     
    391392               
    392393                http_decode( cmd[4] );
    393                 serv_buddy_rename( ic, cmd[3], cmd[4] );
     394                imcb_rename_buddy( ic, cmd[3], cmd[4] );
    394395               
    395396                st = msn_away_state_by_code( cmd[2] );
     
    420421               
    421422                http_decode( cmd[3] );
    422                 serv_buddy_rename( ic, cmd[2], cmd[3] );
     423                imcb_rename_buddy( ic, cmd[2], cmd[3] );
    423424               
    424425                st = msn_away_state_by_code( cmd[1] );
     
    482483                                imcb_error( ic, "Syntax error" );
    483484                                imc_logout( ic, TRUE );
    484                                 return( 0 );
    485                         }
    486                        
    487                         /* We got added by someone. If we don't have this person in permit/deny yet, inform the user. */
     485                                return 0;
     486                        }
     487                       
     488                        /* We got added by someone. If we don't have this
     489                           person in permit/deny yet, inform the user. */
    488490                        for( l = ic->permit; l; l = l->next )
    489491                                if( g_strcasecmp( l->data, cmd[4] ) == 0 )
    490                                         return( 1 );
     492                                        return 1;
    491493                       
    492494                        for( l = ic->deny; l; l = l->next )
    493495                                if( g_strcasecmp( l->data, cmd[4] ) == 0 )
    494                                         return( 1 );
     496                                        return 1;
    495497                       
    496498                        msn_buddy_ask( ic, cmd[4], cmd[5] );
     499                }
     500                else if( num_parts >= 6 && strcmp( cmd[2], "FL" ) == 0 )
     501                {
     502                        http_decode( cmd[5] );
     503                        imcb_add_buddy( ic, cmd[4], NULL );
     504                        imcb_rename_buddy( ic, cmd[4], cmd[5] );
    497505                }
    498506        }
     
    545553                        /* This is not supposed to happen, but let's handle it anyway... */
    546554                        http_decode( cmd[4] );
    547                         serv_buddy_rename( ic, cmd[3], cmd[4] );
     555                        imcb_rename_buddy( ic, cmd[3], cmd[4] );
    548556                }
    549557        }
Note: See TracChangeset for help on using the changeset viewer.