Changes in protocols/jabber/jabber.c [9da0bbf:df1fb67]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r9da0bbf rdf1fb67 197 197 jabber_end_stream( ic ); 198 198 199 while( ic->groupchats )200 jabber_chat_free( ic->groupchats );201 202 199 if( jd->r_inpa >= 0 ) 203 200 b_event_remove( jd->r_inpa ); … … 227 224 struct jabber_buddy *bud; 228 225 struct xt_node *node; 229 char *s;230 226 int st; 231 227 232 if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) 233 return jabber_write( ic, message, strlen( message ) ); 234 235 if( ( s = strchr( who, '=' ) ) && jabber_chat_by_name( ic, s + 1 ) ) 236 bud = jabber_buddy_by_ext_jid( ic, who, 0 ); 237 else 238 bud = jabber_buddy_by_jid( ic, who, 0 ); 228 bud = jabber_buddy_by_jid( ic, who, 0 ); 239 229 240 230 node = xt_new_node( "body", message, NULL ); … … 321 311 static void jabber_add_buddy( struct im_connection *ic, char *who, char *group ) 322 312 { 323 struct jabber_data *jd = ic->proto_data;324 325 if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )326 {327 jd->flags |= JFLAG_XMLCONSOLE;328 imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );329 return;330 }331 332 313 if( jabber_add_to_roster( ic, who, NULL ) ) 333 314 presence_send_request( ic, who, "subscribe" ); … … 336 317 static void jabber_remove_buddy( struct im_connection *ic, char *who, char *group ) 337 318 { 338 struct jabber_data *jd = ic->proto_data;339 340 if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )341 {342 jd->flags &= ~JFLAG_XMLCONSOLE;343 /* Not necessary for now. And for now the code isn't too344 happy if the buddy is completely gone right after calling345 this function already.346 imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );347 */348 return;349 }350 351 319 /* We should always do this part. Clean up our administration a little bit. */ 352 320 jabber_buddy_remove_bare( ic, who ); … … 354 322 if( jabber_remove_from_roster( ic, who ) ) 355 323 presence_send_request( ic, who, "unsubscribe" ); 356 }357 358 static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )359 {360 if( strchr( room, '@' ) == NULL )361 imcb_error( ic, "Invalid room name: %s", room );362 else if( jabber_chat_by_name( ic, room ) )363 imcb_error( ic, "Already present in chat `%s'", room );364 else365 return jabber_chat_join( ic, room, nick, password );366 367 return NULL;368 }369 370 static void jabber_chat_msg_( struct groupchat *c, char *message, int flags )371 {372 if( c && message )373 jabber_chat_msg( c, message, flags );374 }375 376 static void jabber_chat_leave_( struct groupchat *c )377 {378 if( c )379 jabber_chat_leave( c, NULL );380 324 } 381 325 … … 444 388 ret->buddy_msg = jabber_buddy_msg; 445 389 ret->away_states = jabber_away_states; 390 // ret->get_status_string = jabber_get_status_string; 446 391 ret->set_away = jabber_set_away; 447 392 // ret->set_info = jabber_set_info; … … 449 394 ret->add_buddy = jabber_add_buddy; 450 395 ret->remove_buddy = jabber_remove_buddy; 451 ret->chat_msg = jabber_chat_msg_;396 // ret->chat_msg = jabber_chat_msg; 452 397 // ret->chat_invite = jabber_chat_invite; 453 ret->chat_leave = jabber_chat_leave_;454 ret->chat_join = jabber_chat_join_;398 // ret->chat_leave = jabber_chat_leave; 399 // ret->chat_open = jabber_chat_open; 455 400 ret->keepalive = jabber_keepalive; 456 401 ret->send_typing = jabber_send_typing;
Note: See TracChangeset
for help on using the changeset viewer.