Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    r5bd21df ref5c185  
    2424#include "jabber.h"
    2525
    26 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
    27 
    2826struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password )
    2927{
     
    3735        xt_add_attr( node, "xmlns", XMLNS_MUC );
    3836        node = jabber_make_packet( "presence", NULL, roomjid, node );
    39         jabber_cache_add( ic, node, jabber_chat_join_failed );
    4037       
    4138        if( !jabber_write_packet( ic, node ) )
    4239        {
    4340                g_free( roomjid );
     41                xt_free_node( node );
    4442                return NULL;
    4543        }
     44        xt_free_node( node );
    4645       
    4746        jc = g_new0( struct jabber_chat, 1 );
     
    6463       
    6564        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         bud = jabber_buddy_by_jid( ic, room, 0 );
    76        
    77         err = jabber_error_parse( xt_find_node( node->children, "error" ), XMLNS_STANZA_ERROR );
    78         if( err )
    79         {
    80                 imcb_error( ic, "Error joining groupchat %s: %s%s%s",
    81                             bud->bare_jid, err->code, err->text ? ": " : "",
    82                             err->text ? err->text : "" );
    83                 jabber_error_free( err );
    84         }
    85        
    86         if( bud )
    87                 jabber_chat_free( jabber_chat_by_jid( ic, bud->bare_jid ) );
    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;
    10565}
    10666
     
    188148        char *s;
    189149       
    190         if( ( chat = jabber_chat_by_jid( ic, bud->bare_jid ) ) == NULL )
     150        if( ( chat = jabber_chat_by_name( ic, bud->bare_jid ) ) == NULL )
    191151        {
    192152                /* How could this happen?? We could do kill( self, 11 )
     
    290250                return;
    291251        }
    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 )
    293253        {
    294254                /* How could this happen?? We could do kill( self, 11 )
Note: See TracChangeset for help on using the changeset viewer.