Changes in protocols/jabber/conference.c [80e9db9:ef5c185]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
r80e9db9 ref5c185 24 24 #include "jabber.h" 25 25 26 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );27 28 26 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password ) 29 27 { … … 37 35 xt_add_attr( node, "xmlns", XMLNS_MUC ); 38 36 node = jabber_make_packet( "presence", NULL, roomjid, node ); 39 jabber_cache_add( ic, node, jabber_chat_join_failed );40 37 41 38 if( !jabber_write_packet( ic, node ) ) 42 39 { 43 40 g_free( roomjid ); 41 xt_free_node( node ); 44 42 return NULL; 45 43 } 44 xt_free_node( node ); 46 45 47 46 jc = g_new0( struct jabber_chat, 1 ); … … 64 63 65 64 return c; 66 }67 68 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )69 {70 struct jabber_error *err;71 struct jabber_buddy *bud;72 char *room;73 74 room = xt_find_attr( orig, "to" );75 if( ( bud = jabber_buddy_by_jid( ic, room, 0 ) ) )76 jabber_chat_free( jabber_chat_by_jid( ic, bud->bare_jid ) );77 78 err = jabber_error_parse( xt_find_node( node->children, "error" ), XMLNS_STANZA_ERROR );79 if( err )80 {81 imcb_error( ic, "Error joining groupchat %s: %s%s%s",82 bud->bare_jid, err->code, err->text ? ": " : "",83 err->text ? err->text : "" );84 jabber_error_free( err );85 }86 87 return XT_HANDLED;88 }89 90 struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name )91 {92 char *normalized = jabber_normalize( name );93 struct groupchat *ret;94 struct jabber_chat *jc;95 96 for( ret = ic->groupchats; ret; ret = ret->next )97 {98 jc = ret->data;99 if( strcmp( normalized, jc->name ) == 0 )100 break;101 }102 g_free( normalized );103 104 return ret;105 65 } 106 66 … … 188 148 char *s; 189 149 190 if( ( chat = jabber_chat_by_ jid( ic, bud->bare_jid ) ) == NULL )150 if( ( chat = jabber_chat_by_name( ic, bud->bare_jid ) ) == NULL ) 191 151 { 192 152 /* How could this happen?? We could do kill( self, 11 ) … … 290 250 return; 291 251 } 292 else if( ( chat = jabber_chat_by_ jid( ic, bud->bare_jid ) ) == NULL )252 else if( ( chat = jabber_chat_by_name( ic, bud->bare_jid ) ) == NULL ) 293 253 { 294 254 /* How could this happen?? We could do kill( self, 11 )
Note: See TracChangeset
for help on using the changeset viewer.