Changeset a21a8ac for protocols/jabber/jabber.c
- Timestamp:
- 2006-10-10T12:05:42Z (18 years ago)
- Branches:
- master
- Children:
- 8eb10c9
- Parents:
- 6a1128d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r6a1128d ra21a8ac 44 44 s = set_add( &acc->set, "resource", "BitlBee", NULL, acc ); 45 45 s->flags |= ACC_SET_OFFLINE_ONLY; 46 47 s = set_add( &acc->set, "resource_select", "priority", NULL, acc ); 46 48 47 49 s = set_add( &acc->set, "server", NULL, set_eval_account, acc ); … … 137 139 static int jabber_send_im( struct gaim_connection *gc, char *who, char *message, int len, int away ) 138 140 { 141 struct jabber_data *jd = gc->proto_data; 142 struct jabber_buddy *bud; 139 143 struct xt_node *node; 140 144 int st; 141 145 142 /* 143 event = xt_new_node( "active", NULL, NULL ); 144 xt_add_attr( event, "xlmns", "http://jabber.org/protocol/chatstates" ); 145 146 event = xt_new_node( "x", NULL, xt_new_node( "composing", NULL, NULL ) ); 147 xt_add_attr( event, "xmlns", "jabber:x:event" ); 148 */ 146 bud = jabber_buddy_by_jid( gc, who ); 149 147 150 148 node = xt_new_node( "body", message, NULL ); 151 node = jabber_make_packet( "message", "chat", who, node ); 149 node = jabber_make_packet( "message", "chat", bud->full_jid, node ); 150 151 if( ( jd->flags & JFLAG_WANT_TYPING ) && 152 ( ( bud->flags & JBFLAG_DOES_JEP85 ) || 153 !( bud->flags & JBFLAG_PROBED_JEP85 ) ) ) 154 { 155 struct xt_node *act; 156 157 /* If the user likes typing notification and if we don't know 158 (and didn't probe before) if this resource supports JEP85, 159 include a probe in this packet now. */ 160 act = xt_new_node( "active", NULL, NULL ); 161 xt_add_attr( act, "xmlns", "http://jabber.org/protocol/chatstates" ); 162 xt_add_child( node, act ); 163 164 /* Just make sure we do this only once. */ 165 bud->flags |= JBFLAG_PROBED_JEP85; 166 } 167 152 168 st = jabber_write_packet( gc, node ); 153 169 xt_free_node( node ); … … 227 243 is in the cache for about a minute (which should be enough AFAIK). */ 228 244 jabber_cache_clean( gc ); 245 } 246 247 static int jabber_send_typing( struct gaim_connection *gc, char *who, int typing ) 248 { 249 struct jabber_data *jd = gc->proto_data; 250 struct jabber_buddy *bud; 251 252 /* Enable typing notification related code from now. */ 253 jd->flags |= JFLAG_WANT_TYPING; 254 255 bud = jabber_buddy_by_jid( gc, who ); 256 if( bud->flags & JBFLAG_DOES_JEP85 ) 257 { 258 /* We're only allowed to send this stuff if we know the other 259 side supports it. */ 260 261 struct xt_node *node; 262 char *type; 263 int st; 264 265 if( typing == 0 ) 266 type = "active"; 267 else if( typing == 2 ) 268 type = "paused"; 269 else /* if( typing == 1 ) */ 270 type = "composing"; 271 272 node = xt_new_node( type, NULL, NULL ); 273 xt_add_attr( node, "xmlns", "http://jabber.org/protocol/chatstates" ); 274 node = jabber_make_packet( "message", "chat", bud->full_jid, node ); 275 276 st = jabber_write_packet( gc, node ); 277 xt_free_node( node ); 278 279 return st; 280 } 281 282 return 1; 229 283 } 230 284 … … 250 304 // ret->chat_open = jabber_chat_open; 251 305 ret->keepalive = jabber_keepalive; 252 //ret->send_typing = jabber_send_typing;306 ret->send_typing = jabber_send_typing; 253 307 ret->handle_cmp = g_strcasecmp; 254 308
Note: See TracChangeset
for help on using the changeset viewer.