/* opserv.c - IRC Operator assistance service
* Copyright 2000-2004 srvx Development Team
*
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of srvx.
+ *
+ * srvx is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version. Important limitations are
- * listed in the COPYING file that accompanies this software.
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, email srvx-maintainers@srvx.net.
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "conf.h"
{ "OSMSG_RAW_PARSE_ERROR", "Error parsing raw line (not dumping to uplink)." },
{ "OSMSG_COLLIDED_NICK", "Now temporarily holding nick $b%s$b." },
{ "OSMSG_RESERVED_NICK", "Now reserving nick $b%s$b." },
+ { "OSMSG_NICK_UNRESERVED", "Nick $b%s$b is no longer reserved." },
{ "OSMSG_NOT_RESERVED", "Nick $b%s$b is not reserved." },
{ "OSMSG_ILLEGAL_REASON", "This channel is illegal." },
{ "OSMSG_ILLEGAL_KILL_REASON", "Joined an illegal modeless channel - do not repeat." },
{ "OSMSG_CHANINFO_TOPIC_UNKNOWN", "Topic: (none / not gathered)" },
{ "OSMSG_CHANINFO_BAN_COUNT", "Bans (%d):" },
{ "OSMSG_CHANINFO_BAN", "%%s by %%s (%a %b %d %H:%M:%S %Y)" },
- { "OSMSG_CHANINFO_MANY_USERS", "%d users (\"/msg $s %s %s users\" for the list)" },
+ { "OSMSG_CHANINFO_MANY_USERS", "%d users (\"/msg $S %s %s users\" for the list)" },
{ "OSMSG_CHANINFO_USER_COUNT", "Users (%d):" },
{ "OSMSG_CSEARCH_CHANNEL_INFO", "%s [%d users] %s %s" },
{ NULL, NULL }
for (n = 0; n < channel->banlist.used; n++) {
ban = channel->banlist.list[n];
strftime(buffer, sizeof(buffer), fmt, localtime(&ban->set));
- reply(buffer, ban->ban, ban->who);
+ send_message_type(4, user, cmd->parent->bot, buffer, ban->ban, ban->who);
}
}
if ((argc < 2) && (channel->members.used >= 50)) {
change->args[1].mode = MODE_BAN;
change->args[1].hostmask = "*!*@*";
} else {
- change = mod_chanmode_alloc(2);
+ change = mod_chanmode_alloc(1);
change->args[0].mode = MODE_BAN;
change->args[0].hostmask = "*!*@*";
}
continue;
if (!(mn = GetUserMode(channel, victim)))
continue;
- if (!(mn->modes & MODE_CHANOP))
+ if (mn->modes & MODE_CHANOP)
continue;
change->args[count].mode = MODE_CHANOP;
change->args[count++].member = mn;
struct modeNode *mNode = channel->members.list[--nn];
if (IsService(mNode->user))
continue;
- KickChannelUser(mNode->user, channel, opserv, reason);
+ KickChannelUser(mNode->user, channel, opserv, user_find_message(mNode->user, reason));
}
timeq_add(now + opserv_conf.purge_lock_delay, opserv_part_channel, channel);
}
newchan->bad_channel = opserv_bad_channel(newchan->name);
}
+static void
+opserv_channel_delete(struct chanNode *chan)
+{
+ timeq_del(0, opserv_part_channel, chan, TIMEQ_IGNORE_WHEN);
+}
+
static int
opserv_join_check(struct modeNode *mNode)
{
if (channel->name[0] != '#')
DelUser(user, opserv, 1, "OSMSG_ILLEGAL_KILL_REASON");
else if (!GetUserMode(channel, opserv))
- opserv_shutdown_channel(channel, user_find_message(user, "OSMSG_ILLEGAL_REASON"));
+ opserv_shutdown_channel(channel, "OSMSG_ILLEGAL_REASON");
else {
send_message(user, opserv, "OSMSG_ILLEGAL_CHANNEL", channel->name);
msg = user_find_message(user, "OSMSG_ILLEGAL_REASON");
change.modes_set |= MODE_MODERATED;
if (change.modes_set || change.argc)
mod_chanmode_announce(opserv, channel, &change);
- send_channel_notice(channel, opserv, "OSMSG_FLOOD_MODERATE");
+ send_target_message(0, channel->name, opserv, "OSMSG_FLOOD_MODERATE");
opserv_alert("Warning: Possible join flood in %s (currently %d users; channel moderated).", channel->name, channel->members.used);
} else {
opserv_alert("Warning: Possible join flood in %s (currently %d users).", channel->name, channel->members.used);
case 2: iflags = MODCMD_REQUIRE_CHANNEL; break;
}
if (flags) {
- return modcmd_register(opserv_module, name, func, min_argc, iflags, "level", buf, "flags", flags, NULL);
+ return modcmd_register(opserv_module, name, func, min_argc, iflags, "level", buf, "flags", flags, "flags", "+oper", NULL);
} else {
- return modcmd_register(opserv_module, name, func, min_argc, iflags, "level", buf, NULL);
+ return modcmd_register(opserv_module, name, func, min_argc, iflags, "level", buf, "flags", "+oper", NULL);
}
}
reg_nick_change_func(opserv_alert_check_nick);
reg_del_user_func(opserv_user_cleanup);
reg_new_channel_func(opserv_channel_check);
+ reg_del_channel_func(opserv_channel_delete);
reg_join_func(opserv_join_check);
reg_auth_func(opserv_staff_alert);