Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    r565a1ea r63770b4  
    2727#include "bitlbee.h"
    2828#include "ipc.h"
     29#include "chat.h"
    2930
    3031static void irc_cmd_pass( irc_t *irc, char **cmd )
     
    125126static void irc_cmd_mode( irc_t *irc, char **cmd )
    126127{
    127         if( *cmd[1] == '#' || *cmd[1] == '&' )
     128        if( strchr( CTYPES, *cmd[1] ) )
    128129        {
    129130                if( cmd[2] )
     
    193194        else if( cmd[1] )
    194195        {
    195                 if( ( cmd[1][0] == '#' || cmd[1][0] == '&' ) && cmd[1][1] )
    196                 {
    197                         user_t *u = user_find( irc, cmd[1] + 1 );
    198                        
    199                         if( u && u->ic && u->ic->acc->prpl->chat_with )
    200                         {
    201                                 irc_reply( irc, 403, "%s :Initializing groupchat in a different channel", cmd[1] );
    202                                
    203                                 if( !u->ic->acc->prpl->chat_with( u->ic, u->handle ) )
    204                                 {
    205                                         irc_usermsg( irc, "Could not open a groupchat with %s.", u->nick );
    206                                 }
    207                         }
    208                         else if( u )
    209                         {
    210                                 irc_reply( irc, 403, "%s :Groupchats are not possible with %s", cmd[1], cmd[1]+1 );
    211                         }
    212                         else
    213                         {
    214                                 irc_reply( irc, 403, "%s :No such nick", cmd[1] );
    215                         }
    216                 }
     196                struct chat *c;
     197               
     198                if( strchr( CTYPES, cmd[1][0] ) == NULL || cmd[1][1] == 0 )
     199                        irc_reply( irc, 479, "%s :Invalid channel name", cmd[1] );
     200                else if( ( c = chat_bychannel( irc, cmd[1] ) ) && c->acc && c->acc->ic )
     201                        chat_join( irc, c, cmd[2] );
    217202                else
    218                 {
    219203                        irc_reply( irc, 403, "%s :No such channel", cmd[1] );
    220                 }
    221204        }
    222205}
     
    433416                        if( g_hash_table_lookup_extended( irc->watches, nick, &okey, &ovalue ) )
    434417                        {
     418                                g_hash_table_remove( irc->watches, okey );
    435419                                g_free( okey );
    436                                 g_hash_table_remove( irc->watches, okey );
    437420                               
    438421                                irc_reply( irc, 602, "%s %s %s %d :%s", nick, "*", "*", 0, "Stopped watching" );
     
    465448        user_t *u = user_find( irc, irc->nick );
    466449        char *away = cmd[1];
    467         account_t *a;
    468450       
    469451        if( !u ) return;
     
    492474        }
    493475       
    494         for( a = irc->accounts; a; a = a->next )
    495         {
    496                 struct im_connection *ic = a->ic;
    497                
    498                 if( ic && ic->flags & OPT_LOGGED_IN )
    499                         imc_set_away( ic, u->away );
    500         }
     476        set_setstr( &irc->set, "away", u->away );
    501477}
    502478
Note: See TracChangeset for help on using the changeset viewer.