Changeset 08135df for protocols/jabber/conference.c
- Timestamp:
- 2007-12-04T01:08:43Z (17 years ago)
- Branches:
- master
- Children:
- 793cc25
- Parents:
- fa30fa5 (diff), aaf92a9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
rfa30fa5 r08135df 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 26 28 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password ) 27 29 { … … 35 37 xt_add_attr( node, "xmlns", XMLNS_MUC ); 36 38 node = jabber_make_packet( "presence", NULL, roomjid, node ); 39 jabber_cache_add( ic, node, jabber_chat_join_failed ); 37 40 38 41 if( !jabber_write_packet( ic, node ) ) 39 42 { 40 43 g_free( roomjid ); 41 xt_free_node( node );42 44 return NULL; 43 45 } 44 xt_free_node( node );45 46 46 47 jc = g_new0( struct jabber_chat, 1 ); … … 63 64 64 65 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; 65 105 } 66 106 … … 148 188 char *s; 149 189 150 if( ( chat = jabber_chat_by_ name( ic, bud->bare_jid ) ) == NULL )190 if( ( chat = jabber_chat_by_jid( ic, bud->bare_jid ) ) == NULL ) 151 191 { 152 192 /* How could this happen?? We could do kill( self, 11 ) … … 250 290 return; 251 291 } 252 else if( ( chat = jabber_chat_by_ name( ic, bud->bare_jid ) ) == NULL )292 else if( ( chat = jabber_chat_by_jid( ic, bud->bare_jid ) ) == NULL ) 253 293 { 254 294 /* How could this happen?? We could do kill( self, 11 )
Note: See TracChangeset
for help on using the changeset viewer.