Changeset e35d1a1 for protocols/jabber/presence.c
- Timestamp:
- 2007-04-22T20:44:27Z (17 years ago)
- Branches:
- master
- Children:
- 43671b9
- Parents:
- c737ba7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/presence.c
rc737ba7 re35d1a1 31 31 struct xt_node *c; 32 32 struct jabber_buddy *bud; 33 int is_chat = 0; 33 34 char *s; 34 35 35 36 if( !from ) 36 37 return XT_HANDLED; 38 39 if( ( s = strchr( from, '/' ) ) ) 40 { 41 *s = 0; 42 if( jabber_chat_by_name( ic, from ) ) 43 is_chat = 1; 44 *s = '/'; 45 } 37 46 38 47 if( type == NULL ) … … 72 81 bud->priority = 0; 73 82 74 if( bud == jabber_buddy_by_jid( ic, bud->bare_jid, 0 ) ) 83 if( is_chat ) 84 jabber_chat_pkt_presence( ic, bud, node ); 85 else if( bud == jabber_buddy_by_jid( ic, bud->bare_jid, 0 ) ) 75 86 imcb_buddy_status( ic, bud->bare_jid, OPT_LOGGED_IN | is_away, 76 87 ( is_away && bud->away_state ) ? bud->away_state->full_name : NULL, … … 79 90 else if( strcmp( type, "unavailable" ) == 0 ) 80 91 { 81 if( jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT) == NULL )92 if( ( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) ) == NULL ) 82 93 { 83 94 if( set_getbool( &ic->irc->set, "debug" ) ) … … 86 97 } 87 98 99 /* Handle this before we delete the JID. */ 100 if( is_chat ) 101 { 102 jabber_chat_pkt_presence( ic, bud, node ); 103 } 104 88 105 jabber_buddy_remove( ic, from ); 89 106 90 if( ( s = strchr( from, '/' ) ) ) 107 if( is_chat ) 108 { 109 /* Nothing else to do for now? */ 110 } 111 else if( ( s = strchr( from, '/' ) ) ) 91 112 { 92 113 *s = 0; … … 96 117 if( jabber_buddy_by_jid( ic, from, 0 ) == NULL ) 97 118 imcb_buddy_status( ic, from, 0, NULL, NULL ); 119 /* FIXME: If this resource was not away and another resource is, 120 we should definitely send an update here. */ 98 121 99 122 *s = '/';
Note: See TracChangeset
for help on using the changeset viewer.