]> jfr.im git - irc/evilnet/x3.git/commitdiff
help tweak and tab cleanup
authorrubinlinux <redacted>
Tue, 8 Nov 2005 17:30:58 +0000 (17:30 +0000)
committerrubinlinux <redacted>
Tue, 8 Nov 2005 17:30:58 +0000 (17:30 +0000)
ChangeLog.X3
src/modcmd.c

index 167eb4b073683762130225bb71f271d167bd3604..fff493e6b8f89a02e9bfa02922bfb1499313c649 100644 (file)
@@ -3,6 +3,9 @@
 
 2005-11-08  Alex Schumann  <rubin@afternet.org>
 
+       * src/modcmd.c: cleaned up tabs, added hack to display help on JOINER
+       aliases properly.
+
        * src/modcmd.help: Added note about escaping spaces to modcmd help.
 
        * src/nickserv.help: Improved help files
index eb682aba43345dfa17662afbf9c5b39bb5139b1e..9f083e355531abede6ea4a624f0cd3c6293f7c83 100644 (file)
@@ -784,6 +784,29 @@ svccmd_send_help_brief(struct userNode *user, struct userNode *bot, struct svccm
     return r;
 }
 
+int is_joiner(struct svccmd *cmd)
+{
+    if(cmd->command->name)
+    {
+        if(strcasecmp("joiner", cmd->command->name))
+            return(0);
+        else
+            return(1);
+    }
+    return(0);
+/*
+    if(cmd->alias.used)
+    {
+        char alias_text[MAXLEN];
+        unsplit_string((char**)cmd->alias.list, cmd->alias.used, alias_text);
+        if(strcasecmp("joiner", alias_text))
+            return(0);
+        else
+            return(1);
+    }
+*/
+}
+
 int
 svccmd_send_help(struct userNode *user, struct service *service, const char *topic) {
     struct module *module;
@@ -800,8 +823,8 @@ svccmd_send_help(struct userNode *user, struct service *service, const char *top
             cmdname[nn] = toupper(topic[nn]);
     cmdname[nn] = 0;
 
-    /* If there is a command 'topic', send command help for the command */
-    if ((cmd = dict_find(service->commands, topic, NULL)))
+    /* If there is a command 'topic', send command help for the command (unless its bound to JOINER) */
+    if ((cmd = dict_find(service->commands, topic, NULL)) && !is_joiner(cmd))
     {
         send_message(user, service->bot, "MCMSG_HELP_COMMAND_HEADER", cmdname);
         send_message(user, service->bot, "MCMSG_HELP_DIVIDER");
@@ -1278,8 +1301,8 @@ static MODCMD_FUNC(cmd_readhelp) {
     stop.tv_sec -= start.tv_sec;
     stop.tv_usec -= start.tv_usec;
     if (stop.tv_usec < 0) {
-       stop.tv_sec -= 1;
-       stop.tv_usec += 1000000;
+        stop.tv_sec -= 1;
+        stop.tv_usec += 1000000;
     }
     reply("MCMSG_HELPFILE_READ", module->name, stop.tv_sec, stop.tv_usec/1000);
     return 1;
@@ -1303,8 +1326,8 @@ static MODCMD_FUNC(cmd_timecmd) {
     stop.tv_sec -= start.tv_sec;
     stop.tv_usec -= start.tv_usec;
     if (stop.tv_usec < 0) {
-       stop.tv_sec -= 1;
-       stop.tv_usec += 1000000;
+        stop.tv_sec -= 1;
+        stop.tv_usec += 1000000;
     }
     reply("MCMSG_COMMAND_TIME", cmd_text, stop.tv_sec, stop.tv_usec);
     return 1;
@@ -1507,17 +1530,17 @@ static MODCMD_FUNC(cmd_god) {
                 reply("MCMSG_ALREADY_HELPING");
                 return 0;
             }
-           helping = 1;
+            helping = 1;
         } else if (disabled_string(argv[1])) {
             if (!HANDLE_FLAGGED(user->handle_info, HELPING)) {
                 reply("MCMSG_ALREADY_NOT_HELPING");
                 return 0;
             }
-           helping = 0;
+            helping = 0;
         } else {
             reply("MSG_INVALID_BINARY", argv[1]);
             return 0;
-       }
+        }
     } else {
         helping = !IsHelping(user);
     }