Ignore:
Timestamp:
2010-08-15T00:05:49Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
5a7af1b
Parents:
d97f51b
Message:

Read group info.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/soap.c

    rd97f51b rff27648  
    632632        char *id = NULL, *name = NULL;
    633633        struct msn_soap_req_data *soap_req = data;
     634        struct msn_data *md = soap_req->ic->proto_data;
    634635       
    635636        if( ( p = xt_find_path( node, "../groupId" ) ) )
     
    638639        if( ( p = xt_find_node( node->children, "name" ) ) )
    639640                name = p->text;
     641       
     642        if( id && name )
     643        {
     644                struct msn_group *mg = g_new0( struct msn_group, 1 );
     645                mg->id = g_strdup( id );
     646                mg->name = g_strdup( name );
     647                md->groups = g_slist_prepend( md->groups, mg );
     648        }
    640649       
    641650        printf( "%s %s\n", id, name );
     
    649658        struct msn_buddy_data *bd;
    650659        struct xt_node *p;
    651         char *id = NULL, *type = NULL, *handle = NULL, *display_name = NULL;
     660        char *id = NULL, *type = NULL, *handle = NULL,
     661             *display_name = NULL, *group_id = NULL;
    652662        struct msn_soap_req_data *soap_req = data;
    653663        struct im_connection *ic = soap_req->ic;
     664        struct msn_group *group;
    654665       
    655666        if( ( p = xt_find_path( node, "../contactId" ) ) )
     
    661672        if( ( p = xt_find_node( node->children, "displayName" ) ) )
    662673                display_name = p->text;
     674        if( ( p = xt_find_path( node, "groupIds/guid" ) ) )
     675                group_id = p->text;
    663676       
    664677        if( type && g_strcasecmp( type, "me" ) == 0 )
     
    685698        imcb_rename_buddy( ic, handle, display_name );
    686699       
     700        if( group_id && ( group = msn_group_by_id( ic, group_id ) ) )
     701                imcb_add_buddy( ic, handle, group->name );
     702       
    687703        printf( "%s %s %s %s\n", id, type, handle, display_name );
    688704       
Note: See TracChangeset for help on using the changeset viewer.