Ignore:
Timestamp:
2006-09-21T09:37:03Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
5bcf70a
Parents:
dd788bb
Message:

Added simple parsing of incoming <presence> tags, a nice </stream:stream>
at the end of sessions, support for sending messages, and restored the old
(and leaking) xt_print(), which I'll only use for debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    rdd788bb r4a0614e  
    2626xt_status jabber_pkt_presence( struct xt_node *node, gpointer data )
    2727{
     28        struct gaim_connection *gc = data;
    2829        char *from = xt_find_attr( node, "from" );
     30        char *type = xt_find_attr( node, "type" );      /* NULL should mean the person is online. */
     31        char *s;
    2932       
    30         printf( "Received PRES from %s:\n", from );
    31         xt_print( node );
     33        if( !from )
     34                return XT_HANDLED;
     35       
     36        s = strchr( from, '/' );
     37        if( s )
     38                *s = 0;
     39       
     40        if( type == NULL )
     41                serv_got_update( gc, from, 1, 0, 0, 0, 0, 0 );
     42        else if( strcmp( type, "unavailable" ) == 0 )
     43                serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 );
     44        else
     45        {
     46                printf( "Received PRES from %s:\n", from );
     47                xt_print( node );
     48        }
     49       
     50        if( s )
     51                *s = '/';
    3252       
    3353        return XT_HANDLED;
Note: See TracChangeset for help on using the changeset viewer.