Changeset 0da65d5 for protocols/jabber/presence.c
- Timestamp:
- 2007-03-31T05:40:45Z (17 years ago)
- Branches:
- master
- Children:
- aef4828
- Parents:
- fa29d093
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/presence.c
rfa29d093 r0da65d5 26 26 xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ) 27 27 { 28 struct gaim_connection *gc = data;28 struct im_connection *ic = data; 29 29 char *from = xt_find_attr( node, "from" ); 30 30 char *type = xt_find_attr( node, "type" ); /* NULL should mean the person is online. */ … … 38 38 if( type == NULL ) 39 39 { 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 ) ) ) 41 41 { 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 ); 44 44 return XT_HANDLED; 45 45 } … … 66 66 bud->priority = 0; 67 67 68 serv_got_update( gc, bud->bare_jid, 1, 0, 0, 0,68 serv_got_update( ic, bud->bare_jid, 1, 0, 0, 0, 69 69 bud->away_state ? UC_UNAVAILABLE : 0, 0 ); 70 70 } 71 71 else if( strcmp( type, "unavailable" ) == 0 ) 72 72 { 73 if( jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT ) == NULL )73 if( jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) == NULL ) 74 74 { 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 ); 77 77 return XT_HANDLED; 78 78 } 79 79 80 jabber_buddy_remove( gc, from );80 jabber_buddy_remove( ic, from ); 81 81 82 82 if( ( s = strchr( from, '/' ) ) ) … … 86 86 /* Only count this as offline if there's no other resource 87 87 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 ); 90 90 91 91 *s = '/'; … … 93 93 else 94 94 { 95 serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 );95 serv_got_update( ic, from, 0, 0, 0, 0, 0, 0 ); 96 96 } 97 97 } 98 98 else if( strcmp( type, "subscribe" ) == 0 ) 99 99 { 100 jabber_buddy_ask( gc, from );100 jabber_buddy_ask( ic, from ); 101 101 } 102 102 else if( strcmp( type, "subscribed" ) == 0 ) 103 103 { 104 104 /* 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 ); 106 106 } 107 107 else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 ) … … 131 131 /* Whenever presence information is updated, call this function to inform the 132 132 server. */ 133 int presence_send_update( struct gaim_connection *gc )133 int presence_send_update( struct im_connection *ic ) 134 134 { 135 struct jabber_data *jd = gc->proto_data;135 struct jabber_data *jd = ic->proto_data; 136 136 struct xt_node *node; 137 137 char *show = jd->away_state->code; … … 140 140 141 141 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 ) ); 143 143 if( show && *show ) 144 144 xt_add_child( node, xt_new_node( "show", show, NULL ) ); … … 146 146 xt_add_child( node, xt_new_node( "status", status, NULL ) ); 147 147 148 st = jabber_write_packet( gc, node );148 st = jabber_write_packet( ic, node ); 149 149 150 150 xt_free_node( node ); … … 153 153 154 154 /* Send a subscribe/unsubscribe request to a buddy. */ 155 int presence_send_request( struct gaim_connection *gc, char *handle, char *request )155 int presence_send_request( struct im_connection *ic, char *handle, char *request ) 156 156 { 157 157 struct xt_node *node; … … 162 162 xt_add_attr( node, "type", request ); 163 163 164 st = jabber_write_packet( gc, node );164 st = jabber_write_packet( ic, node ); 165 165 166 166 xt_free_node( node );
Note: See TracChangeset
for help on using the changeset viewer.