Ignore:
Timestamp:
2006-09-20T20:26:47Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
dd788bb
Parents:
70f6aab8
Message:

Now parsing roster properly. (Hopefully...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r70f6aab8 r0b4a0db  
    8787                return st ? XT_HANDLED : XT_ABORT;
    8888        }
     89        if( strcmp( type, "result" ) == 0 && xmlns && strcmp( xmlns, "jabber:iq:roster" ) == 0 )
     90        {
     91                struct xt_node *node;
     92               
     93                node = query->children;
     94                while( ( node = xt_find_node( node, "item" ) ) )
     95                {
     96                        char *jid = xt_find_attr( node, "jid" );
     97                        char *name = xt_find_attr( node, "name" );
     98                        char *sub = xt_find_attr( node, "subscription" );
     99                       
     100                        if( jid && sub && ( strcmp( sub, "both" ) == 0 || strcmp( sub, "to" ) == 0 ) )
     101                                add_buddy( gc, NULL, jid, name );
     102                       
     103                        node = node->next;
     104                }
     105               
     106                presence_announce( gc );
     107        }
    89108        else if( strcmp( type, "result" ) == 0 )
    90109        {
Note: See TracChangeset for help on using the changeset viewer.