Changeset 0d3f30f for protocols/jabber/presence.c
- Timestamp:
- 2006-11-12T23:06:08Z (17 years ago)
- Branches:
- master
- Children:
- 16b5f86
- Parents:
- 47d3ac4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/presence.c
r47d3ac4 r0d3f30f 38 38 if( type == NULL ) 39 39 { 40 if( ( s = strchr( from, '/' ) ) == NULL)40 if( !( bud = jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) ) 41 41 { 42 char *s = xt_to_string( node ); 43 serv_got_crap( gc, "WARNING: Ignoring presence tag with bare JID: %s", s ); 44 g_free( s ); 42 serv_got_crap( gc, "WARNING: Could not handle presence information from JID: %s", from ); 45 43 return XT_HANDLED; 46 }47 48 if( !( bud = jabber_buddy_by_jid( gc, from ) ) )49 {50 /* FOR NOW, s still contains the location of the /.51 Keep this in mind when changing things here. :-) */52 53 /* We check if the buddy is in the contact list,54 because Jabber servers seem to like to send55 presence information of buddies we removed56 from our list sometimes, for example... */57 58 *s = 0;59 if( find_buddy( gc, from ) == NULL )60 {61 *s = '/';62 serv_got_crap( gc, "WARNING: Ignoring presence information from unknown JID: %s", from );63 return XT_HANDLED;64 }65 *s = '/';66 67 bud = jabber_buddy_add( gc, from );68 44 } 69 45 … … 89 65 bud->priority = 0; 90 66 91 serv_got_update( gc, bud-> handle, 1, 0, 0, 0,67 serv_got_update( gc, bud->bare_jid, 1, 0, 0, 0, 92 68 bud->away_state ? UC_UNAVAILABLE : 0, 0 ); 93 69 } 94 70 else if( strcmp( type, "unavailable" ) == 0 ) 95 71 { 96 char *s; 97 98 if( ( s = strchr( from, '/' ) ) == NULL ) 99 { 100 char *s = xt_to_string( node ); 101 serv_got_crap( gc, "WARNING: Ignoring presence tag with bare JID: %s\n", s ); 102 g_free( s ); 103 return XT_HANDLED; 104 } 105 106 if( jabber_buddy_by_jid( gc, from ) == NULL ) 72 if( jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT ) == NULL ) 107 73 { 108 74 serv_got_crap( gc, "WARNING: Received presence information from unknown JID: %s", from ); … … 111 77 112 78 jabber_buddy_remove( gc, from ); 113 *s = 0;114 79 115 /* Only count this as offline if there's no other resource 116 available anymore. */ 117 if( jabber_buddy_by_jid( gc, from ) == NULL ) 80 if( ( s = strchr( from, '/' ) ) ) 81 { 82 *s = 0; 83 84 /* Only count this as offline if there's no other resource 85 available anymore. */ 86 if( jabber_buddy_by_jid( gc, from, 0 ) == NULL ) 87 serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 ); 88 89 *s = '/'; 90 } 91 else 92 { 118 93 serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 ); 119 120 *s = '/'; 94 } 121 95 } 122 96 else if( strcmp( type, "subscribe" ) == 0 ) … … 126 100 else if( strcmp( type, "subscribed" ) == 0 ) 127 101 { 102 /* Not sure about this one, actually... */ 128 103 serv_got_crap( gc, "%s just accepted your authorization request", from ); 129 104 }
Note: See TracChangeset
for help on using the changeset viewer.