}
static int
-svccmd_expand_alias(struct svccmd *cmd, unsigned int old_argc, char *old_argv[], char *new_argv[]) {
+svccmd_expand_alias(struct svccmd *cmd, struct userNode *user, unsigned int old_argc, char *old_argv[], char *new_argv[]) {
unsigned int ii, new_argc;
char *arg;
for (jj = lbound; jj <= ubound; )
new_argv[new_argc++] = old_argv[jj++];
} else {
- log_module(MAIN_LOG, LOG_ERROR, "Alias expansion: I do not know how to handle %s (%s.%s arg %d).", arg, cmd->parent->bot->nick, cmd->name, ii);
- return 0;
+ switch(arg[1]) {
+ case 'a':
+ new_argv[new_argc++] = (user && user->handle_info) ? user->handle_info->handle : "(account)";
+ break;
+ case 'n':
+ new_argv[new_argc++] = user ? user->nick : "(nick)";
+ break;
+ case 'm':
+#ifdef WITH_PROTOCOL_P10
+ new_argv[new_argc++] = user ? user->numeric : "(numnick)";
+#else
+ new_argv[new_argc++] = "(This ircd protocol has no numnicks!)";
+#endif
+ break;
+ default:
+ log_module(MAIN_LOG, LOG_ERROR, "Alias expansion: I do not know how to handle %s (%s.%s arg %d).", arg, cmd->parent->bot->nick, cmd->name, ii);
+ return 0;
+ }
}
}
return new_argc;
unsigned int cmd_arg, perms, flags, options;
char channel_name[CHANNELLEN+1];
- /* First check pubcmd for the channel. */
- if (channel && (channel->channel_info) && (service->bot == chanserv)
- && !check_user_level(channel, user, lvlPubCmd, 1, 0)) {
- send_message(user, service->bot, "MCMSG_PUBLIC_DENY", channel->name);
- return 0;
- }
-
options = (server_qualified ? SVCCMD_QUALIFIED : 0) | SVCCMD_DEBIT | SVCCMD_NOISY;
/* Find the command argument. */
cmd_arg = IsChannelName(argv[0]) ? 1 : 0;
send_message(user, service->bot, "MSG_COMMAND_UNKNOWN", argv[cmd_arg]);
return 0;
}
+
+ /* Check pubcmd for the channel. */
+ if (channel && (channel->channel_info) && (service->bot == chanserv)
+ && !check_user_level(channel, user, lvlPubCmd, 1, 0)) {
+ send_message(user, service->bot, "MCMSG_PUBLIC_DENY", channel->name);
+ return 0;
+ }
+
flags = cmd->effective_flags;
/* If they put a channel name first, check if the command allows
* it. If so, swap it with the command name.
/* Expand the alias arguments, if there are any. */
if (cmd->alias.used) {
char *new_argv[MAXNUMPARAMS];
- argc = svccmd_expand_alias(cmd, argc, argv, new_argv);
+ argc = svccmd_expand_alias(cmd, user, argc, argv, new_argv);
if (!argc) {
- send_message(service->bot, user, "MCMSG_ALIAS_ERROR", cmd->name);
+ send_message(user, service->bot, "MCMSG_ALIAS_ERROR", cmd->name);
return 0;
}
argv = new_argv;
default:
return arg;
}
- } else
- return arg;
+ } else {
+ switch(argv[arg][1]) {
+ case 'a':
+ case 'n':
+ case 'm':
+ continue;
+ default:
+ return arg;
+ }
+ }
}
return arg;
}
send_message_type(4, user, cmd->parent->bot, "$b"PACKAGE_STRING"+[%s %s]$b (Based on srvx 1.3.x), Built: "__DATE__", "__TIME__".", svnver, svndate);
send_message_type(4, user, cmd->parent->bot, "$b$b");
- send_message_type(4, user, cmd->parent->bot, "Copyright 2000-2006 srvx Development Team.");
- send_message_type(4, user, cmd->parent->bot, "Copyright 2004-2006 X3 Development Team.");
+ send_message_type(4, user, cmd->parent->bot, "Copyright 2000-2007 srvx Development Team.");
+ send_message_type(4, user, cmd->parent->bot, "Copyright 2004-2007 X3 Development Team.");
+ send_message_type(4, user, cmd->parent->bot, "This software is OSI Certified Open Source Software.");
+ 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 can be reached at http://sourceforge.net/projects/evilnet or in #evilnet on irc.afternet.org.");
+ 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 Adrian M (thiefmaster), Joe Hansche (joeatrr), Martijn Smit (wasted), and to any other people who have contributed to X3.");
+ 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.");
send_message_type(4, user, cmd->parent->bot, "This program is free software; see COPYING in the distribution.");
return 1;
/* Now some silly hax.. (aliases that most people want) */
if (!irccasecmp(def_binds[ii].svcname, "ChanServ")) {
- service_make_alias(service, "addowner", "*chanserv.adduser", "$1", "owner", NULL);
- service_make_alias(service, "addcoowner", "*chanserv.adduser", "$1", "coowner", NULL);
- service_make_alias(service, "addco", "*chanserv.adduser", "$1", "coowner", NULL);
- service_make_alias(service, "addmanager", "*chanserv.adduser", "$1", "manager", NULL);
- service_make_alias(service, "addop", "*chanserv.adduser", "$1", "op", NULL);
- service_make_alias(service, "addhop", "*chanserv.adduser", "$1", "halfop", NULL);
- service_make_alias(service, "addpeon", "*chanserv.adduser", "$1", "peon", NULL);
+ service_make_alias(service, "addowner", "*chanserv.adduser", "$1", "owner", "$2", NULL);
+ service_make_alias(service, "addcoowner", "*chanserv.adduser", "$1", "coowner", "$2", NULL);
+ service_make_alias(service, "addco", "*chanserv.adduser", "$1", "coowner", "$2", NULL);
+ service_make_alias(service, "addmanager", "*chanserv.adduser", "$1", "manager", "$2", NULL);
+ service_make_alias(service, "addop", "*chanserv.adduser", "$1", "op", "$2", NULL);
+ service_make_alias(service, "addhop", "*chanserv.adduser", "$1", "halfop", "$2", NULL);
+ service_make_alias(service, "addpeon", "*chanserv.adduser", "$1", "peon", "$2", NULL);
service_make_alias(service, "delowner", "*chanserv.deluser", "owner", "$1", NULL);
service_make_alias(service, "delcoowner", "*chanserv.deluser", "coowner", "$1", NULL);
service_make_alias(service, "delmanager", "*chanserv.deluser", "manager", "$1", NULL);
svccmd->min_opserv_level = 101;
svccmd = service_make_alias(service, "service", "*modcmd.joiner", NULL);
svccmd->min_opserv_level = 900;
+ svccmd = service_make_alias(service, "routing", "*modcmd.joiner", NULL);
+ svccmd->min_opserv_level = 100;
}
}
}