Ignore:
Timestamp:
2007-03-31T05:40:45Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aef4828
Parents:
fa29d093
Message:

s/gaim_connection/im_connection/ and some other minor API changes. The rest
will come tomorrow. It compiles, I'll leave the real testing up to someone
else. ;-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    rfa29d093 r0da65d5  
    2626xt_status jabber_pkt_presence( struct xt_node *node, gpointer data )
    2727{
    28         struct gaim_connection *gc = data;
     28        struct im_connection *ic = data;
    2929        char *from = xt_find_attr( node, "from" );
    3030        char *type = xt_find_attr( node, "type" );      /* NULL should mean the person is online. */
     
    3838        if( type == NULL )
    3939        {
    40                 if( !( bud = jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) )
     40                if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) )
    4141                {
    42                         if( set_getbool( &gc->irc->set, "debug" ) )
    43                                 serv_got_crap( gc, "WARNING: Could not handle presence information from JID: %s", from );
     42                        if( set_getbool( &ic->irc->set, "debug" ) )
     43                                serv_got_crap( ic, "WARNING: Could not handle presence information from JID: %s", from );
    4444                        return XT_HANDLED;
    4545                }
     
    6666                        bud->priority = 0;
    6767               
    68                 serv_got_update( gc, bud->bare_jid, 1, 0, 0, 0,
     68                serv_got_update( ic, bud->bare_jid, 1, 0, 0, 0,
    6969                                 bud->away_state ? UC_UNAVAILABLE : 0, 0 );
    7070        }
    7171        else if( strcmp( type, "unavailable" ) == 0 )
    7272        {
    73                 if( jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT ) == NULL )
     73                if( jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) == NULL )
    7474                {
    75                         if( set_getbool( &gc->irc->set, "debug" ) )
    76                                 serv_got_crap( gc, "WARNING: Received presence information from unknown JID: %s", from );
     75                        if( set_getbool( &ic->irc->set, "debug" ) )
     76                                serv_got_crap( ic, "WARNING: Received presence information from unknown JID: %s", from );
    7777                        return XT_HANDLED;
    7878                }
    7979               
    80                 jabber_buddy_remove( gc, from );
     80                jabber_buddy_remove( ic, from );
    8181               
    8282                if( ( s = strchr( from, '/' ) ) )
     
    8686                        /* Only count this as offline if there's no other resource
    8787                           available anymore. */
    88                         if( jabber_buddy_by_jid( gc, from, 0 ) == NULL )
    89                                 serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 );
     88                        if( jabber_buddy_by_jid( ic, from, 0 ) == NULL )
     89                                serv_got_update( ic, from, 0, 0, 0, 0, 0, 0 );
    9090                       
    9191                        *s = '/';
     
    9393                else
    9494                {
    95                         serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 );
     95                        serv_got_update( ic, from, 0, 0, 0, 0, 0, 0 );
    9696                }
    9797        }
    9898        else if( strcmp( type, "subscribe" ) == 0 )
    9999        {
    100                 jabber_buddy_ask( gc, from );
     100                jabber_buddy_ask( ic, from );
    101101        }
    102102        else if( strcmp( type, "subscribed" ) == 0 )
    103103        {
    104104                /* Not sure about this one, actually... */
    105                 serv_got_crap( gc, "%s just accepted your authorization request", from );
     105                serv_got_crap( ic, "%s just accepted your authorization request", from );
    106106        }
    107107        else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 )
     
    131131/* Whenever presence information is updated, call this function to inform the
    132132   server. */
    133 int presence_send_update( struct gaim_connection *gc )
     133int presence_send_update( struct im_connection *ic )
    134134{
    135         struct jabber_data *jd = gc->proto_data;
     135        struct jabber_data *jd = ic->proto_data;
    136136        struct xt_node *node;
    137137        char *show = jd->away_state->code;
     
    140140       
    141141        node = jabber_make_packet( "presence", NULL, NULL, NULL );
    142         xt_add_child( node, xt_new_node( "priority", set_getstr( &gc->acc->set, "priority" ), NULL ) );
     142        xt_add_child( node, xt_new_node( "priority", set_getstr( &ic->acc->set, "priority" ), NULL ) );
    143143        if( show && *show )
    144144                xt_add_child( node, xt_new_node( "show", show, NULL ) );
     
    146146                xt_add_child( node, xt_new_node( "status", status, NULL ) );
    147147       
    148         st = jabber_write_packet( gc, node );
     148        st = jabber_write_packet( ic, node );
    149149       
    150150        xt_free_node( node );
     
    153153
    154154/* Send a subscribe/unsubscribe request to a buddy. */
    155 int presence_send_request( struct gaim_connection *gc, char *handle, char *request )
     155int presence_send_request( struct im_connection *ic, char *handle, char *request )
    156156{
    157157        struct xt_node *node;
     
    162162        xt_add_attr( node, "type", request );
    163163       
    164         st = jabber_write_packet( gc, node );
     164        st = jabber_write_packet( ic, node );
    165165       
    166166        xt_free_node( node );
Note: See TracChangeset for help on using the changeset viewer.