Changeset 4f22a68c for root_commands.c


Ignore:
Timestamp:
2010-07-18T20:12:55Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
94d5da9c
Parents:
3e59c8d
Message:

Automatically operate on the current channel if just using "channel set".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r3e59c8d r4f22a68c  
    550550        }
    551551       
     552        if( ( ic = irc_channel_get( irc, cmd[1] ) ) == NULL )
     553        {
     554                /* If this doesn't match any channel, maybe this is the short
     555                   syntax (only works when used inside a channel). */
     556                if( ( len = strlen( cmd[1] ) ) &&
     557                    g_strncasecmp( cmd[1], "set", len ) == 0 &&
     558                    ( ic = irc_channel_by_name( irc, irc->last_root_cmd ) ) )
     559                        cmd_set_real( irc, cmd + 1, &ic->set, NULL );
     560                else
     561                        irc_usermsg( irc, "Could not find channel `%s'", cmd[1] );
     562               
     563                return;
     564        }
     565       
    552566        MIN_ARGS( 2 );
    553567        len = strlen( cmd[2] );
    554        
    555         if( ( ic = irc_channel_get( irc, cmd[1] ) ) == NULL )
    556         {
    557                 irc_usermsg( irc, "Could not find channel `%s'", cmd[1] );
    558                 return;
    559         }
    560568       
    561569        if( len >= 1 && g_strncasecmp( cmd[2], "set", len ) == 0 )
Note: See TracChangeset for help on using the changeset viewer.