Changeset 673a54c for irc_commands.c


Ignore:
Timestamp:
2009-03-12T19:33:28Z (15 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
Branches:
master
Children:
fc34fb5
Parents:
823de9d (diff), 9e768da (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.
Message:

pretty blind try at merging in the latest trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    r823de9d r673a54c  
    125125static void irc_cmd_mode( irc_t *irc, char **cmd )
    126126{
    127         if( *cmd[1] == '#' || *cmd[1] == '&' )
     127        if( strchr( CTYPES, *cmd[1] ) )
    128128        {
    129129                if( cmd[2] )
     
    193193        else if( cmd[1] )
    194194        {
    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                 }
     195                struct chat *c;
     196               
     197                if( strchr( CTYPES, cmd[1][0] ) == NULL || cmd[1][1] == 0 )
     198                        irc_reply( irc, 479, "%s :Invalid channel name", cmd[1] );
     199                else if( ( c = chat_bychannel( irc, cmd[1] ) ) && c->acc && c->acc->ic )
     200                        chat_join( irc, c, cmd[2] );
    217201                else
    218                 {
    219202                        irc_reply( irc, 403, "%s :No such channel", cmd[1] );
    220                 }
    221203        }
    222204}
Note: See TracChangeset for help on using the changeset viewer.