Changeset d7d677d for irc_commands.c


Ignore:
Timestamp:
2010-04-14T12:34:39Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
003a12b
Parents:
d33679e
Message:

Restored a few more trivial commands including all the oper stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    rd33679e rd7d677d  
    351351
    352352
    353 #if 0
    354353static void irc_cmd_oper( irc_t *irc, char **cmd )
    355354{
     
    368367}
    369368
     369#if 0
    370370static void irc_cmd_invite( irc_t *irc, char **cmd )
    371371{
     
    553553}
    554554
    555 #if 0
    556555static void irc_cmd_version( irc_t *irc, char **cmd )
    557556{
    558         irc_send_num( irc, 351, "bitlbee-%s. %s :%s/%s ", BITLBEE_VERSION, irc->myhost, ARCH, CPU );
     557        irc_send_num( irc, 351, "bitlbee-%s. %s :%s/%s ",
     558                      BITLBEE_VERSION, irc->root->host, ARCH, CPU );
    559559}
    560560
    561561static void irc_cmd_completions( irc_t *irc, char **cmd )
    562562{
    563         user_t *u = user_find( irc, irc->mynick );
    564563        help_t *h;
    565564        set_t *s;
    566565        int i;
    567566       
    568         irc_privmsg( irc, u, "NOTICE", irc->nick, "COMPLETIONS ", "OK" );
     567        irc_send_msg_raw( irc->root, "NOTICE", irc->user->nick, "COMPLETIONS OK" );
    569568       
    570569        for( i = 0; commands[i].command; i ++ )
    571                 irc_privmsg( irc, u, "NOTICE", irc->nick, "COMPLETIONS ", commands[i].command );
     570                irc_send_msg_f( irc->root, "NOTICE", irc->user->nick, "COMPLETIONS %s", commands[i].command );
    572571       
    573572        for( h = global.help; h; h = h->next )
    574                 irc_privmsg( irc, u, "NOTICE", irc->nick, "COMPLETIONS help ", h->title );
    575        
    576         for( s = irc->set; s; s = s->next )
    577                 irc_privmsg( irc, u, "NOTICE", irc->nick, "COMPLETIONS set ", s->key );
    578        
    579         irc_privmsg( irc, u, "NOTICE", irc->nick, "COMPLETIONS ", "END" );
     573                irc_send_msg_f( irc->root, "NOTICE", irc->user->nick, "COMPLETIONS help %s", h->title );
     574       
     575        for( s = irc->b->set; s; s = s->next )
     576                irc_send_msg_f( irc->root, "NOTICE", irc->user->nick, "COMPLETIONS set %s", s->key );
     577       
     578        irc_send_msg_raw( irc->root, "NOTICE", irc->user->nick, "COMPLETIONS END" );
    580579}
    581580
     
    589588        irc_send_num( irc, 382, "%s :Rehashing", global.conf_file );
    590589}
    591 #endif
    592590
    593591static const command_t irc_commands[] = {
     
    610608        { "ns",          1, irc_cmd_nickserv,    IRC_CMD_LOGGED_IN },
    611609        { "away",        0, irc_cmd_away,        IRC_CMD_LOGGED_IN },
     610        { "version",     0, irc_cmd_version,     IRC_CMD_LOGGED_IN },
     611        { "completions", 0, irc_cmd_completions, IRC_CMD_LOGGED_IN },
     612        { "oper",        2, irc_cmd_oper,        IRC_CMD_LOGGED_IN },
    612613#if 0
    613         { "oper",        2, irc_cmd_oper,        IRC_CMD_LOGGED_IN },
    614614        { "invite",      2, irc_cmd_invite,      IRC_CMD_LOGGED_IN },
    615615        { "notice",      1, irc_cmd_privmsg,     IRC_CMD_LOGGED_IN },
     
    618618        { "watch",       1, irc_cmd_watch,       IRC_CMD_LOGGED_IN },
    619619        { "topic",       1, irc_cmd_topic,       IRC_CMD_LOGGED_IN },
    620         { "version",     0, irc_cmd_version,     IRC_CMD_LOGGED_IN },
    621         { "completions", 0, irc_cmd_completions, IRC_CMD_LOGGED_IN },
     620#endif
    622621        { "die",         0, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    623622        { "deaf",        0, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
     
    627626        { "restart",     0, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    628627        { "kill",        2, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    629 #endif
    630628        { NULL }
    631629};
Note: See TracChangeset for help on using the changeset viewer.