/* 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." },
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;
#endif
reply("OSMSG_WHOIS_SERVER", target->uplink->name);
reply("OSMSG_WHOIS_ACCOUNT", (target->handle_info ? target->handle_info->handle : "Not authenticated"));
- intervalString(buffer, now - target->timestamp);
+ intervalString(buffer, now - target->timestamp, user->handle_info);
reply("OSMSG_WHOIS_NICK_AGE", buffer);
if (target->channels.used <= MAX_CHANNELS_WHOIS)
opserv_ison(user, target, "OSMSG_WHOIS_CHANNELS");
#endif
tbl.contents[nn][1] = buffer;
ofs = strlen(buffer) + 1;
- intervalString(buffer + ofs, now - server->link);
- if (server->self_burst) strcat(buffer + ofs, " Bursting");
+ intervalString(buffer + ofs, now - server->link, user->handle_info);
+ if (server->self_burst)
+ strcat(buffer + ofs, " Bursting");
tbl.contents[nn][2] = buffer + ofs;
nn++;
}
th = dict_find(opserv_trusted_hosts, argv[1], NULL);
if (th) {
if (th->issued)
- intervalString(issued, now - th->issued);
+ intervalString(issued, now - th->issued, user->handle_info);
if (th->expires)
- intervalString(length, th->expires - now);
+ intervalString(length, th->expires - now, user->handle_info);
if (th->limit)
sprintf(limit, "limit %lu", th->limit);
reply("OSMSG_HOST_IS_TRUSTED",
for (it = dict_first(opserv_trusted_hosts); it; it = iter_next(it)) {
th = iter_data(it);
if (th->issued)
- intervalString(issued, now - th->issued);
+ intervalString(issued, now - th->issued, user->handle_info);
if (th->expires)
- intervalString(length, th->expires - now);
+ intervalString(length, th->expires - now, user->handle_info);
if (th->limit)
sprintf(limit, "limit %lu", th->limit);
reply("OSMSG_HOST_IS_TRUSTED", iter_key(it),
clocks_per_sec = CLOCKS_PER_SEC;
}
}
- intervalString(uptime, time(NULL)-boot_time);
+ intervalString(uptime, time(NULL)-boot_time, user->handle_info);
times(&buf);
reply("OSMSG_UPTIME_STATS",
uptime, lines_processed,
table.contents[0][3] = "Reason";
for (nn=1, gag=gagList; gag; nn++, gag=gag->next) {
char expstr[INTERVALLEN];
- if (gag->expires) intervalString(expstr, gag->expires - now);
- else strcpy(expstr, "Never");
+ if (gag->expires)
+ intervalString(expstr, gag->expires - now, user->handle_info);
+ else
+ strcpy(expstr, "Never");
table.contents[nn] = calloc(table.width, sizeof(char*));
table.contents[nn][0] = gag->mask;
table.contents[nn][1] = gag->owner;
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");
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);