]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/modcmd.c
About time I added myself to the credits
[irc/evilnet/x3.git] / src / modcmd.c
index f523c257c90c9078b99b715052a9ba579a52a196..6800e1afc5d9a53dc169f152928ecf57db720f13 100644 (file)
@@ -18,7 +18,6 @@
  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include "../ChangeLog"
 #include "chanserv.h"
 #include "conf.h"
 #include "compat.h"
@@ -26,6 +25,7 @@
 #include "opserv.h"
 #include "saxdb.h"
 #include "timeq.h"
+#include "version.h"
 
 
 struct pending_template {
@@ -608,7 +608,9 @@ svccmd_expand_alias(struct svccmd *cmd, struct userNode *user, unsigned int old_
         if (arg[1] == '$') {
             new_argv[new_argc++] = arg + 1;
         } else if (isdigit(arg[1])) {
-            unsigned int lbound, ubound, jj;
+            unsigned int lbound = 0;
+            unsigned int ubound = 0;
+            unsigned int jj = 0;
             char *end_num;
 
             lbound = strtoul(arg+1, &end_num, 10);
@@ -691,6 +693,7 @@ svccmd_invoke_argv(struct userNode *user, struct service *service, struct chanNo
     struct svccmd *cmd;
     unsigned int cmd_arg, perms, flags, options, result;
     char channel_name[CHANNELLEN+1];
+    char *new_argv[MAXNUMPARAMS]; /* for aliases */
 
     options = (server_qualified ? SVCCMD_QUALIFIED : 0) | SVCCMD_DEBIT | SVCCMD_NOISY;
     /* Find the command argument. */
@@ -754,7 +757,6 @@ svccmd_invoke_argv(struct userNode *user, struct service *service, struct chanNo
 
     /* Expand the alias arguments, if there are any. */
     if (cmd->alias.used) {
-        char *new_argv[MAXNUMPARAMS];
         int res;
 
         res = svccmd_expand_alias(cmd, user, argc, argv, new_argv);
@@ -808,8 +810,11 @@ svccmd_invoke_argv(struct userNode *user, struct service *service, struct chanNo
         safestrncpy(channel_name, channel->name, sizeof(channel_name));
     else
         channel_name[0] = 0;
-    if (!(result = cmd->command->func(user, channel, argc, argv, cmd)))
+
+    /* Call the function here */
+    if (!(result = cmd->command->func(user, channel, argc, argv, cmd))) 
         return 0;
+
     if (!(flags & MODCMD_NO_LOG)) {
         enum log_severity slvl;
         if (result & CMD_LOG_OVERRIDE)
@@ -976,28 +981,6 @@ svccmd_invoke(struct userNode *user, struct service *service, struct chanNode *c
     return argc ? svccmd_invoke_argv(user, service, channel, argc, argv, server_qualified) : 0;
 }
 
-char *cvs_verstring() {
-  static char verstring[MAXLEN] = { 0 };
-  
-  if(!*verstring) {
-    char *svn = NULL, *svnver = NULL, *svndate = NULL, *v = 0, ver[MAXLEN];
-    int vc = 0;
-
-    strcpy(ver, CVS_VERSION);
-    for (svn = x3_strtok(&v, ver, " "); svn;
-         svn = x3_strtok(&v, 0, " ")) {
-        if (vc == 2)
-            svnver = svn;
-        else if (vc == 3)
-            svndate = svn;
-        vc++;
-    }
-    sprintf(verstring, "%s %s", svnver, svndate);
-  }
-  return verstring;
-}
-
-
 void
 modcmd_privmsg(struct userNode *user, struct userNode *bot, const char *text, int server_qualified) {
     struct service *service;
@@ -1046,7 +1029,7 @@ modcmd_privmsg(struct userNode *user, struct userNode *bot, const char *text, in
             snprintf(response, sizeof(response), "\x01USERINFO %s\x01", bot->info);
             irc_notice_user(bot, user, response);
         } else if (!irccasecmp(text, "VERSION")) {
-            snprintf(response, sizeof(response), "\x01VERSION %s+[%s]\x01", PACKAGE_STRING, cvs_verstring());
+            snprintf(response, sizeof(response), "\x01VERSION %s+[%s]\x01", PACKAGE_STRING, cvs_version);
             irc_notice_user(bot, user, response);
         } else if (!irccasecmp(text, "GENDER")) {
              snprintf(response, sizeof(response), "\x01GENDER ummm im still deciding\x01");
@@ -2059,7 +2042,7 @@ static MODCMD_FUNC(cmd_dump_messages) {
 }
 
 static MODCMD_FUNC(cmd_version) {
-    send_message_type(4, user, cmd->parent->bot, "$b"PACKAGE_STRING"+[%s]$b (Based on srvx 1.3.x), Built: "__DATE__", "__TIME__".", cvs_verstring());
+    send_message_type(4, user, cmd->parent->bot, "$b"PACKAGE_STRING"+[%s]$b (Based on srvx 1.3.x), Built: "__DATE__", "__TIME__".", cvs_version);
     send_message_type(4, user, cmd->parent->bot, "See $bCREDITS$b for more information.");
     return 1;
 }
@@ -2077,7 +2060,7 @@ static MODCMD_FUNC(cmd_credits) {
     send_message_type(4, user, cmd->parent->bot, "OSI Certified is a certification mark of the Open Source Initiative.");
     send_message_type(4, user, cmd->parent->bot, "$b$b");
     send_message_type(4, user, cmd->parent->bot, "The srvx 1.3.x Development Team includes Paul Chang, Adrian Dewhurst, Miles Peterson, Michael Poole and others.");
-    send_message_type(4, user, cmd->parent->bot, "The X3 Development Team includes Alex Schumann, Reed Loden, Neil Spierling.");
+    send_message_type(4, user, cmd->parent->bot, "The X3 Development Team includes Alex Schumann, Reed Loden, Neil Spierling, Matthew Beeching.");
     send_message_type(4, user, cmd->parent->bot, "The X3 Development Team can be reached at http://evilnet.sourceforge.net or in #evilnet on irc.afternet.org.");
     send_message_type(4, user, cmd->parent->bot, "$b$b");
     send_message_type(4, user, cmd->parent->bot, "Thanks goes to ThiefMaster, Joe Hansche (joeatrr), Martijn Smit (wasted), and to any other people who have contributed to X3.");