Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    ra6df0b5 rdf1fb67  
    5454       
    5555        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 );
    5956        s->flags |= ACC_SET_OFFLINE_ONLY;
    6057}
     
    192189                imc_logout( ic, TRUE );
    193190        }
    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. But
    199                    I think this shouldn't break anything. */
    200                 imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
    201         }
    202191}
    203192
     
    207196       
    208197        jabber_end_stream( ic );
    209        
    210         while( ic->groupchats )
    211                 jabber_chat_free( ic->groupchats );
    212198       
    213199        if( jd->r_inpa >= 0 )
     
    238224        struct jabber_buddy *bud;
    239225        struct xt_node *node;
    240         char *s;
    241226        int st;
    242227       
    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 );
    250229       
    251230        node = xt_new_node( "body", message, NULL );
     
    332311static void jabber_add_buddy( struct im_connection *ic, char *who, char *group )
    333312{
    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        
    343313        if( jabber_add_to_roster( ic, who, NULL ) )
    344314                presence_send_request( ic, who, "subscribe" );
     
    347317static void jabber_remove_buddy( struct im_connection *ic, char *who, char *group )
    348318{
    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 too
    355                    happy if the buddy is completely gone right after calling
    356                    this function already.
    357                 imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
    358                 */
    359                 return;
    360         }
    361        
    362319        /* We should always do this part. Clean up our administration a little bit. */
    363320        jabber_buddy_remove_bare( ic, who );
     
    365322        if( jabber_remove_from_roster( ic, who ) )
    366323                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         else
    376                 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_leave_( struct groupchat *c )
    388 {
    389         if( c )
    390                 jabber_chat_leave( c, NULL );
    391324}
    392325
     
    455388        ret->buddy_msg = jabber_buddy_msg;
    456389        ret->away_states = jabber_away_states;
     390//      ret->get_status_string = jabber_get_status_string;
    457391        ret->set_away = jabber_set_away;
    458392//      ret->set_info = jabber_set_info;
     
    460394        ret->add_buddy = jabber_add_buddy;
    461395        ret->remove_buddy = jabber_remove_buddy;
    462         ret->chat_msg = jabber_chat_msg_;
     396//      ret->chat_msg = jabber_chat_msg;
    463397//      ret->chat_invite = jabber_chat_invite;
    464         ret->chat_leave = jabber_chat_leave_;
    465         ret->chat_join = jabber_chat_join_;
     398//      ret->chat_leave = jabber_chat_leave;
     399//      ret->chat_open = jabber_chat_open;
    466400        ret->keepalive = jabber_keepalive;
    467401        ret->send_typing = jabber_send_typing;
Note: See TracChangeset for help on using the changeset viewer.