diff options
Diffstat (limited to 'protocols/jabber/presence.c')
-rw-r--r-- | protocols/jabber/presence.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/protocols/jabber/presence.c b/protocols/jabber/presence.c index 2e6b41ab..2db32fd1 100644 --- a/protocols/jabber/presence.c +++ b/protocols/jabber/presence.c @@ -25,7 +25,7 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ) { - struct gaim_connection *gc = data; + struct im_connection *ic = data; char *from = xt_find_attr( node, "from" ); char *type = xt_find_attr( node, "type" ); /* NULL should mean the person is online. */ struct xt_node *c; @@ -37,10 +37,10 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ) if( type == NULL ) { - if( !( bud = jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) ) + if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) ) { - if( set_getbool( &gc->irc->set, "debug" ) ) - serv_got_crap( gc, "WARNING: Could not handle presence information from JID: %s", from ); + if( set_getbool( &ic->irc->set, "debug" ) ) + serv_got_crap( ic, "WARNING: Could not handle presence information from JID: %s", from ); return XT_HANDLED; } @@ -65,19 +65,19 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ) else bud->priority = 0; - serv_got_update( gc, bud->bare_jid, 1, 0, 0, 0, + serv_got_update( ic, bud->bare_jid, 1, 0, 0, 0, bud->away_state ? UC_UNAVAILABLE : 0, 0 ); } else if( strcmp( type, "unavailable" ) == 0 ) { - if( jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT ) == NULL ) + if( jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) == NULL ) { - if( set_getbool( &gc->irc->set, "debug" ) ) - serv_got_crap( gc, "WARNING: Received presence information from unknown JID: %s", from ); + if( set_getbool( &ic->irc->set, "debug" ) ) + serv_got_crap( ic, "WARNING: Received presence information from unknown JID: %s", from ); return XT_HANDLED; } - jabber_buddy_remove( gc, from ); + jabber_buddy_remove( ic, from ); if( ( s = strchr( from, '/' ) ) ) { @@ -85,24 +85,24 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ) /* Only count this as offline if there's no other resource available anymore. */ - if( jabber_buddy_by_jid( gc, from, 0 ) == NULL ) - serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 ); + if( jabber_buddy_by_jid( ic, from, 0 ) == NULL ) + serv_got_update( ic, from, 0, 0, 0, 0, 0, 0 ); *s = '/'; } else { - serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 ); + serv_got_update( ic, from, 0, 0, 0, 0, 0, 0 ); } } else if( strcmp( type, "subscribe" ) == 0 ) { - jabber_buddy_ask( gc, from ); + jabber_buddy_ask( ic, from ); } else if( strcmp( type, "subscribed" ) == 0 ) { /* Not sure about this one, actually... */ - serv_got_crap( gc, "%s just accepted your authorization request", from ); + serv_got_crap( ic, "%s just accepted your authorization request", from ); } else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 ) { @@ -130,29 +130,29 @@ xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ) /* Whenever presence information is updated, call this function to inform the server. */ -int presence_send_update( struct gaim_connection *gc ) +int presence_send_update( struct im_connection *ic ) { - struct jabber_data *jd = gc->proto_data; + struct jabber_data *jd = ic->proto_data; struct xt_node *node; char *show = jd->away_state->code; char *status = jd->away_message; int st; node = jabber_make_packet( "presence", NULL, NULL, NULL ); - xt_add_child( node, xt_new_node( "priority", set_getstr( &gc->acc->set, "priority" ), NULL ) ); + xt_add_child( node, xt_new_node( "priority", set_getstr( &ic->acc->set, "priority" ), NULL ) ); if( show && *show ) xt_add_child( node, xt_new_node( "show", show, NULL ) ); if( status ) xt_add_child( node, xt_new_node( "status", status, NULL ) ); - st = jabber_write_packet( gc, node ); + st = jabber_write_packet( ic, node ); xt_free_node( node ); return st; } /* Send a subscribe/unsubscribe request to a buddy. */ -int presence_send_request( struct gaim_connection *gc, char *handle, char *request ) +int presence_send_request( struct im_connection *ic, char *handle, char *request ) { struct xt_node *node; int st; @@ -161,7 +161,7 @@ int presence_send_request( struct gaim_connection *gc, char *handle, char *reque xt_add_attr( node, "to", handle ); xt_add_attr( node, "type", request ); - st = jabber_write_packet( gc, node ); + st = jabber_write_packet( ic, node ); xt_free_node( node ); return st; |