Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r9da0bbf rdf1fb67  
    197197        jabber_end_stream( ic );
    198198       
    199         while( ic->groupchats )
    200                 jabber_chat_free( ic->groupchats );
    201        
    202199        if( jd->r_inpa >= 0 )
    203200                b_event_remove( jd->r_inpa );
     
    227224        struct jabber_buddy *bud;
    228225        struct xt_node *node;
    229         char *s;
    230226        int st;
    231227       
    232         if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
    233                 return jabber_write( ic, message, strlen( message ) );
    234        
    235         if( ( s = strchr( who, '=' ) ) && jabber_chat_by_name( ic, s + 1 ) )
    236                 bud = jabber_buddy_by_ext_jid( ic, who, 0 );
    237         else
    238                 bud = jabber_buddy_by_jid( ic, who, 0 );
     228        bud = jabber_buddy_by_jid( ic, who, 0 );
    239229       
    240230        node = xt_new_node( "body", message, NULL );
     
    321311static void jabber_add_buddy( struct im_connection *ic, char *who, char *group )
    322312{
    323         struct jabber_data *jd = ic->proto_data;
    324        
    325         if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
    326         {
    327                 jd->flags |= JFLAG_XMLCONSOLE;
    328                 imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
    329                 return;
    330         }
    331        
    332313        if( jabber_add_to_roster( ic, who, NULL ) )
    333314                presence_send_request( ic, who, "subscribe" );
     
    336317static void jabber_remove_buddy( struct im_connection *ic, char *who, char *group )
    337318{
    338         struct jabber_data *jd = ic->proto_data;
    339        
    340         if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
    341         {
    342                 jd->flags &= ~JFLAG_XMLCONSOLE;
    343                 /* Not necessary for now. And for now the code isn't too
    344                    happy if the buddy is completely gone right after calling
    345                    this function already.
    346                 imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
    347                 */
    348                 return;
    349         }
    350        
    351319        /* We should always do this part. Clean up our administration a little bit. */
    352320        jabber_buddy_remove_bare( ic, who );
     
    354322        if( jabber_remove_from_roster( ic, who ) )
    355323                presence_send_request( ic, who, "unsubscribe" );
    356 }
    357 
    358 static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )
    359 {
    360         if( strchr( room, '@' ) == NULL )
    361                 imcb_error( ic, "Invalid room name: %s", room );
    362         else if( jabber_chat_by_name( ic, room ) )
    363                 imcb_error( ic, "Already present in chat `%s'", room );
    364         else
    365                 return jabber_chat_join( ic, room, nick, password );
    366        
    367         return NULL;
    368 }
    369 
    370 static void jabber_chat_msg_( struct groupchat *c, char *message, int flags )
    371 {
    372         if( c && message )
    373                 jabber_chat_msg( c, message, flags );
    374 }
    375 
    376 static void jabber_chat_leave_( struct groupchat *c )
    377 {
    378         if( c )
    379                 jabber_chat_leave( c, NULL );
    380324}
    381325
     
    444388        ret->buddy_msg = jabber_buddy_msg;
    445389        ret->away_states = jabber_away_states;
     390//      ret->get_status_string = jabber_get_status_string;
    446391        ret->set_away = jabber_set_away;
    447392//      ret->set_info = jabber_set_info;
     
    449394        ret->add_buddy = jabber_add_buddy;
    450395        ret->remove_buddy = jabber_remove_buddy;
    451         ret->chat_msg = jabber_chat_msg_;
     396//      ret->chat_msg = jabber_chat_msg;
    452397//      ret->chat_invite = jabber_chat_invite;
    453         ret->chat_leave = jabber_chat_leave_;
    454         ret->chat_join = jabber_chat_join_;
     398//      ret->chat_leave = jabber_chat_leave;
     399//      ret->chat_open = jabber_chat_open;
    455400        ret->keepalive = jabber_keepalive;
    456401        ret->send_typing = jabber_send_typing;
Note: See TracChangeset for help on using the changeset viewer.