Changeset d7f8500 for irc_commands.c


Ignore:
Timestamp:
2010-06-30T23:01:33Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
9052bc1
Parents:
217bf4e
Message:

Support /NOTICE, although for now just to yourself - some IRC clients use
this to measure lag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    r217bf4e rd7f8500  
    332332                irc_send_num( irc, 401, "%s :No such nick/channel", cmd[1] );
    333333        }
     334}
     335
     336static void irc_cmd_notice( irc_t *irc, char **cmd )
     337{
     338        if( !cmd[2] )
     339        {
     340                irc_send_num( irc, 412, ":No text to send" );
     341                return;
     342        }
     343       
     344        /* At least for now just echo. IIRC some IRC clients use self-notices
     345           for lag checks, so try to support that. */
     346        if( nick_cmp( cmd[1], irc->user->nick ) == 0 )
     347                irc_send_msg( irc->user, "NOTICE", irc->user->nick, cmd[2], NULL );
    334348}
    335349
     
    603617        { "who",         0, irc_cmd_who,         IRC_CMD_LOGGED_IN },
    604618        { "privmsg",     1, irc_cmd_privmsg,     IRC_CMD_LOGGED_IN },
     619        { "notice",      1, irc_cmd_notice,      IRC_CMD_LOGGED_IN },
    605620        { "nickserv",    1, irc_cmd_nickserv,    IRC_CMD_LOGGED_IN },
    606621        { "ns",          1, irc_cmd_nickserv,    IRC_CMD_LOGGED_IN },
     
    612627        { "watch",       1, irc_cmd_watch,       IRC_CMD_LOGGED_IN },
    613628        { "invite",      2, irc_cmd_invite,      IRC_CMD_LOGGED_IN },
    614 #if 0
    615         { "notice",      1, irc_cmd_privmsg,     IRC_CMD_LOGGED_IN },
    616 #endif
    617629        { "topic",       1, irc_cmd_topic,       IRC_CMD_LOGGED_IN },
    618630        { "oper",        2, irc_cmd_oper,        IRC_CMD_LOGGED_IN },
Note: See TracChangeset for help on using the changeset viewer.