Ignore:
Timestamp:
2006-09-24T18:08:07Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
8e5e2e9
Parents:
e101506
Message:

Added add_buddy/remove_buddy functions. Removing a contact doesn't seem
to work perfectly though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    re101506 rcfbb3a6  
    184184        return st;
    185185}
     186
     187int jabber_add_to_roster( struct gaim_connection *gc, char *handle, char *name )
     188{
     189        struct xt_node *node;
     190        int st;
     191       
     192        /* Build the item entry */
     193        node = xt_new_node( "item", NULL, NULL );
     194        xt_add_attr( node, "jid", handle );
     195        if( name )
     196                xt_add_attr( node, "name", name );
     197       
     198        /* And pack it into a roster-add packet */
     199        node = xt_new_node( "query", NULL, node );
     200        xt_add_attr( node, "xmlns", "jabber:iq:roster" );
     201        node = jabber_make_packet( "iq", "set", NULL, node );
     202       
     203        st = jabber_write_packet( gc, node );
     204       
     205        xt_free_node( node );
     206        return st;
     207}
     208
     209int jabber_remove_from_roster( struct gaim_connection *gc, char *handle )
     210{
     211        struct xt_node *node;
     212        int st;
     213       
     214        /* Build the item entry */
     215        node = xt_new_node( "item", NULL, NULL );
     216        xt_add_attr( node, "jid", handle );
     217        xt_add_attr( node, "subscription", "remove" );
     218       
     219        /* And pack it into a roster-add packet */
     220        node = xt_new_node( "query", NULL, node );
     221        xt_add_attr( node, "xmlns", "jabber:iq:roster" );
     222        node = jabber_make_packet( "iq", "set", NULL, node );
     223       
     224        st = jabber_write_packet( gc, node );
     225       
     226        xt_free_node( node );
     227        return st;
     228}
Note: See TracChangeset for help on using the changeset viewer.