[srvx-commits] CVS: services/src helpserv.help,1.5,1.6 helpserv.c,1.13,1.14
Brought to you by:
entrope
From: Entrope <en...@us...> - 2002-06-21 00:32:20
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv2251/src Modified Files: helpserv.help helpserv.c Log Message: simplify helpserv_oper_cmd a little don't allow moving to the same channel the bot already supports require MOVE to go through OpServ (like the other oper-only commands) correct documentation of the oper-only commands (e.g. not "?helpserv move addowner OpServ ....") Index: helpserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.help,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** helpserv.help 18 May 2002 04:04:21 -0000 1.5 --- helpserv.help 21 Jun 2002 00:32:17 -0000 1.6 *************** *** 48,52 **** "$uSee also:$u helpers, addhelper, clvl, deluser"); "ADDOWNER" ("$bADDOWNER$b", ! "/msg $O HELPSERV ADDOWNER $S <nick|*account>", "Add the specified user to the bot as a owner.", "$uSee also:$u clvl, delowner, helpers"); --- 48,52 ---- "$uSee also:$u helpers, addhelper, clvl, deluser"); "ADDOWNER" ("$bADDOWNER$b", ! "/msg $O HELPSERV ADDOWNER <bot-nick> <nick|*account>", "Add the specified user to the bot as a owner.", "$uSee also:$u clvl, delowner, helpers"); *************** *** 66,70 **** "$uSee also:$u addhelper, addmanager, deluser, helpers"); "DELOWNER" ("$bDELOWNER$b", ! "/msg $O HELPSERV DELOWNER $S <nick|*account>", "Delete an owner from the channel user list. (Secretly, this is just an alias for deluser.)", "$uSee also:$u clvl, deluser, helpers"); --- 66,70 ---- "$uSee also:$u addhelper, addmanager, deluser, helpers"); "DELOWNER" ("$bDELOWNER$b", ! "/msg $O HELPSERV DELOWNER <bot-nick> <nick|*account>", "Delete an owner from the channel user list. (Secretly, this is just an alias for deluser.)", "$uSee also:$u clvl, deluser, helpers"); *************** *** 90,95 **** "$uSee also:$u next, pickup"); "MOVE" ("$bMOVE$b", ! "/msg $S MOVE <new-nick|#new-channel>", ! "Changes $S to use a new nick or new channel."); "NEXT" ("$bNEXT$b", "/msg $S NEXT", --- 90,95 ---- "$uSee also:$u next, pickup"); "MOVE" ("$bMOVE$b", ! "/msg $O HELPSERV <bot-nick> MOVE <new-nick|#new-channel>", ! "Makes the HelpServ bot use a different nick or channel."); "NEXT" ("$bNEXT$b", "/msg $S NEXT", Index: helpserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** helpserv.c 11 Jun 2002 13:54:47 -0000 1.13 --- helpserv.c 21 Jun 2002 00:32:17 -0000 1.14 *************** *** 159,162 **** --- 159,163 ---- #define HSMSG_RENAMED "%s has been renamed to $b%s$b." #define HSMSG_MOVED "%s has been moved to $b%s$b." + #define HSMSG_MOVE_SAME_CHANNEL "You cannot move %s to the same channel it is on." #define HSMSG_INVALID_MOVE "$b%s$b is not a valid nick or channel name." *************** *** 799,805 **** struct helpserv_cmd *cmd; const int from_opserv = 1; /* for helpserv_notice */ ! unsigned char *cmd_argv[MAXNUMPARAMS]; ! char botnick[NICKLEN+1]; ! int retval, i; if (!helpserv_enabled) { --- 800,805 ---- struct helpserv_cmd *cmd; const int from_opserv = 1; /* for helpserv_notice */ ! char botnick[NICKLEN+1]; /* in case command is unregister */ ! int retval; if (!helpserv_enabled) { *************** *** 818,821 **** --- 818,826 ---- } + if (!cmd->func) { + helpserv_notice(user, HSMSG_INTERNAL_COMMAND, argv[0]); + return 0; + } + if ((cmd->flags & CMD_NEED_BOT) && ((argc < 2) || !(hs = dict_find(helpserv_bots_dict, argv[1], NULL)))) { helpserv_notice(user, HSMSG_INVALID_BOT); *************** *** 828,846 **** } ! if (cmd->func) { ! if (hs) { ! cmd_argv[0] = argv[0]; ! for (i=2; i<argc; i++) { ! cmd_argv[i-1] = argv[i]; ! } ! strcpy(botnick, hs->helpserv->nick); ! retval = cmd->func(user, hs, 1, argc-1, cmd_argv); ! } else { ! strcpy(botnick, "No Bot"); ! retval = cmd->func(user, hs, 1, argc, argv); ! } } else { ! helpserv_notice(user, HSMSG_INTERNAL_COMMAND, argv[0]); ! return 0; } --- 833,843 ---- } ! if (hs) { ! argv[1] = argv[0]; ! strcpy(botnick, hs->helpserv->nick); ! retval = cmd->func(user, hs, 1, argc-1, argv+1); } else { ! strcpy(botnick, "No bot"); ! retval = cmd->func(user, hs, 1, argc, argv); } *************** *** 1811,1814 **** --- 1808,1816 ---- strcpy(oldchan, hs->helpchan->name); + if (!strcasecmp(oldchan, newchan)) { + helpserv_notice(user, HSMSG_MOVE_SAME_CHANNEL, hs->helpserv->nick); + return 0; + } + if (opserv_bad_channel(newchan)) { helpserv_notice(user, HSMSG_ILLEGAL_CHANNEL, newchan); *************** *** 3732,3736 **** helpserv_define_func("WRITE", cmd_write, HlOper, CMD_FROM_OPSERV_ONLY); helpserv_define_func("REGISTER", cmd_register, HlOper, CMD_FROM_OPSERV_ONLY); ! helpserv_define_func("MOVE", cmd_move, HlOper, CMD_NEED_BOT); helpserv_define_func("BOTS", cmd_bots, HlOper, CMD_FROM_OPSERV_ONLY|CMD_IGNORE_EVENT); --- 3734,3738 ---- helpserv_define_func("WRITE", cmd_write, HlOper, CMD_FROM_OPSERV_ONLY); helpserv_define_func("REGISTER", cmd_register, HlOper, CMD_FROM_OPSERV_ONLY); ! helpserv_define_func("MOVE", cmd_move, HlOper, CMD_FROM_OPSERV_ONLY|CMD_NEED_BOT); helpserv_define_func("BOTS", cmd_bots, HlOper, CMD_FROM_OPSERV_ONLY|CMD_IGNORE_EVENT); |