Changes in protocols/jabber/jabber.c [ef5c185:df1fb67]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
ref5c185 rdf1fb67 54 54 55 55 s = set_add( &acc->set, "tls", "try", set_eval_tls, acc ); 56 s->flags |= ACC_SET_OFFLINE_ONLY;57 58 s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc );59 56 s->flags |= ACC_SET_OFFLINE_ONLY; 60 57 } … … 192 189 imc_logout( ic, TRUE ); 193 190 } 194 195 if( set_getbool( &acc->set, "xmlconsole" ) )196 {197 jd->flags |= JFLAG_XMLCONSOLE;198 /* Shouldn't really do this at this stage already, maybe. But199 I think this shouldn't break anything. */200 imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );201 }202 191 } 203 192 … … 207 196 208 197 jabber_end_stream( ic ); 209 210 while( ic->groupchats )211 jabber_chat_free( ic->groupchats );212 198 213 199 if( jd->r_inpa >= 0 ) … … 238 224 struct jabber_buddy *bud; 239 225 struct xt_node *node; 240 char *s;241 226 int st; 242 227 243 if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) 244 return jabber_write( ic, message, strlen( message ) ); 245 246 if( ( s = strchr( who, '=' ) ) && jabber_chat_by_name( ic, s + 1 ) ) 247 bud = jabber_buddy_by_ext_jid( ic, who, 0 ); 248 else 249 bud = jabber_buddy_by_jid( ic, who, 0 ); 228 bud = jabber_buddy_by_jid( ic, who, 0 ); 250 229 251 230 node = xt_new_node( "body", message, NULL ); … … 332 311 static void jabber_add_buddy( struct im_connection *ic, char *who, char *group ) 333 312 { 334 struct jabber_data *jd = ic->proto_data;335 336 if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )337 {338 jd->flags |= JFLAG_XMLCONSOLE;339 imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );340 return;341 }342 343 313 if( jabber_add_to_roster( ic, who, NULL ) ) 344 314 presence_send_request( ic, who, "subscribe" ); … … 347 317 static void jabber_remove_buddy( struct im_connection *ic, char *who, char *group ) 348 318 { 349 struct jabber_data *jd = ic->proto_data;350 351 if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )352 {353 jd->flags &= ~JFLAG_XMLCONSOLE;354 /* Not necessary for now. And for now the code isn't too355 happy if the buddy is completely gone right after calling356 this function already.357 imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );358 */359 return;360 }361 362 319 /* We should always do this part. Clean up our administration a little bit. */ 363 320 jabber_buddy_remove_bare( ic, who ); … … 365 322 if( jabber_remove_from_roster( ic, who ) ) 366 323 presence_send_request( ic, who, "unsubscribe" ); 367 }368 369 static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )370 {371 if( strchr( room, '@' ) == NULL )372 imcb_error( ic, "Invalid room name: %s", room );373 else if( jabber_chat_by_name( ic, room ) )374 imcb_error( ic, "Already present in chat `%s'", room );375 else376 return jabber_chat_join( ic, room, nick, password );377 378 return NULL;379 }380 381 static void jabber_chat_msg_( struct groupchat *c, char *message, int flags )382 {383 if( c && message )384 jabber_chat_msg( c, message, flags );385 }386 387 static void jabber_chat_topic_( struct groupchat *c, char *topic )388 {389 if( c && topic )390 jabber_chat_topic( c, topic );391 }392 393 static void jabber_chat_leave_( struct groupchat *c )394 {395 if( c )396 jabber_chat_leave( c, NULL );397 324 } 398 325 … … 461 388 ret->buddy_msg = jabber_buddy_msg; 462 389 ret->away_states = jabber_away_states; 390 // ret->get_status_string = jabber_get_status_string; 463 391 ret->set_away = jabber_set_away; 464 392 // ret->set_info = jabber_set_info; … … 466 394 ret->add_buddy = jabber_add_buddy; 467 395 ret->remove_buddy = jabber_remove_buddy; 468 ret->chat_msg = jabber_chat_msg_; 469 ret->chat_topic = jabber_chat_topic_; 396 // ret->chat_msg = jabber_chat_msg; 470 397 // ret->chat_invite = jabber_chat_invite; 471 ret->chat_leave = jabber_chat_leave_;472 ret->chat_join = jabber_chat_join_;398 // ret->chat_leave = jabber_chat_leave; 399 // ret->chat_open = jabber_chat_open; 473 400 ret->keepalive = jabber_keepalive; 474 401 ret->send_typing = jabber_send_typing;
Note: See TracChangeset
for help on using the changeset viewer.