Changeset e7f8838 for protocols/jabber
- Timestamp:
- 2008-01-11T13:17:11Z (17 years ago)
- Branches:
- master
- Children:
- e64de00
- Parents:
- e731120
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/presence.c
re731120 re7f8838 30 30 char *type = xt_find_attr( node, "type" ); /* NULL should mean the person is online. */ 31 31 struct xt_node *c; 32 struct jabber_buddy *bud ;33 int is_chat = 0 , is_away = 0;32 struct jabber_buddy *bud, *send_presence = NULL; 33 int is_chat = 0; 34 34 char *s; 35 35 … … 63 63 { 64 64 bud->away_state = (void*) jabber_away_state_by_code( c->text ); 65 if( strcmp( c->text, "chat" ) != 0 )66 is_away = OPT_AWAY;67 65 } 68 66 else … … 81 79 if( is_chat ) 82 80 jabber_chat_pkt_presence( ic, bud, node ); 83 else if( bud == jabber_buddy_by_jid( ic, bud->bare_jid, 0 ) ) 84 imcb_buddy_status( ic, bud->bare_jid, OPT_LOGGED_IN | is_away, 85 ( is_away && bud->away_state ) ? bud->away_state->full_name : NULL, 86 bud->away_message ); 81 else 82 send_presence = jabber_buddy_by_jid( ic, bud->bare_jid, 0 ); 87 83 } 88 84 else if( strcmp( type, "unavailable" ) == 0 ) … … 119 115 /* If another resource is still available, send its presence 120 116 information. */ 121 if( ( bud = jabber_buddy_by_jid( ic, from, 0 ) ) ) 122 { 123 if( bud->away_state && ( *bud->away_state->code == 0 || 124 strcmp( bud->away_state->code, "chat" ) == 0 ) ) 125 is_away = OPT_AWAY; 126 127 imcb_buddy_status( ic, bud->bare_jid, OPT_LOGGED_IN | is_away, 128 ( is_away && bud->away_state ) ? bud->away_state->full_name : NULL, 129 bud->away_message ); 130 } 131 else 117 if( ( send_presence = jabber_buddy_by_jid( ic, from, 0 ) ) == NULL ) 132 118 { 133 119 /* Otherwise, count him/her as offline now. */ … … 176 162 jabber_error_free( err ); 177 163 } */ 164 } 165 166 if( send_presence ) 167 { 168 int is_away; 169 170 if( send_presence->away_state && !( *send_presence->away_state->code == 0 || 171 strcmp( send_presence->away_state->code, "chat" ) == 0 ) ) 172 is_away = OPT_AWAY; 173 174 imcb_buddy_status( ic, send_presence->bare_jid, OPT_LOGGED_IN | is_away, 175 ( is_away && send_presence->away_state ) ? 176 send_presence->away_state->full_name : NULL, 177 send_presence->away_message ); 178 178 } 179 179
Note: See TracChangeset
for help on using the changeset viewer.