change.argc = 1;
change.args[0].mode = MODE_BAN;
if (is_ircmask(argv[1]))
- change.args[0].hostmask = strdup(argv[1]);
+ change.args[0].u.hostmask = strdup(argv[1]);
else if ((victim = GetUserH(argv[1])))
- change.args[0].hostmask = generate_hostmask(victim, 0);
+ change.args[0].u.hostmask = generate_hostmask(victim, 0);
else {
reply("OSMSG_INVALID_IRCMASK", argv[1]);
return 0;
}
modcmd_chanmode_announce(&change);
- reply("OSMSG_ADDED_BAN", change.args[0].hostmask, channel->name);
- free((char*)change.args[0].hostmask);
+ reply("OSMSG_ADDED_BAN", change.args[0].u.hostmask, channel->name);
+ free((char*)change.args[0].u.hostmask);
return 1;
}
change = mod_chanmode_alloc(channel->banlist.used);
for (ii=0; ii<channel->banlist.used; ii++) {
change->args[ii].mode = MODE_REMOVE | MODE_BAN;
- change->args[ii].hostmask = channel->banlist.list[ii]->ban;
+ change->args[ii].u.hostmask = channel->banlist.list[ii]->ban;
}
modcmd_chanmode_announce(change);
mod_chanmode_free(change);
|| !(mn->modes & MODE_CHANOP))
continue;
change->args[count].mode = MODE_REMOVE | MODE_CHANOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
|| !(mn->modes & MODE_HALFOP))
continue;
change->args[count].mode = MODE_REMOVE | MODE_HALFOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
if (IsService(mn->user) || !(mn->modes & MODE_CHANOP))
continue;
change->args[count].mode = MODE_REMOVE | MODE_CHANOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
if (IsService(mn->user) || !(mn->modes & MODE_HALFOP))
continue;
change->args[count].mode = MODE_REMOVE | MODE_HALFOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
return 0;
}
if (GetUserMode(opserv_conf.debug_channel, user)) {
- reply("OSMSG_ALREADY_THERE", channel->name);
+ reply("OSMSG_ALREADY_THERE", opserv_conf.debug_channel->name);
return 0;
}
irc_invite(cmd->parent->bot, target, opserv_conf.debug_channel);
mod_chanmode_init(&change);
change.argc = 1;
change.args[0].mode = MODE_CHANOP;
- change.args[0].member = AddChannelUser(bot, channel);
+ change.args[0].u.member = AddChannelUser(bot, channel);
modcmd_chanmode_announce(&change);
}
irc_fetchtopic(bot, channel->name);
struct mod_chanmode change;
mod_chanmode_init(&change);
change.args[0].mode = MODE_CHANOP;
- change.args[0].member = AddChannelUser(bot, channel);
+ change.args[0].u.member = AddChannelUser(bot, channel);
modcmd_chanmode_announce(&change);
}
if (argc < 2) {
mod_chanmode_init(&change);
change.argc = 1;
change.args[0].mode = MODE_BAN;
- change.args[0].hostmask = mask = generate_hostmask(target, 0);
+ change.args[0].u.hostmask = mask = generate_hostmask(target, 0);
modcmd_chanmode_announce(&change);
KickChannelUser(target, channel, cmd->parent->bot, reason);
free(mask);
if (!(inchan = GetUserMode(channel, bot) ? 1 : 0)) {
change = mod_chanmode_alloc(2);
change->args[0].mode = MODE_CHANOP;
- change->args[0].member = AddChannelUser(bot, channel);
+ change->args[0].u.member = AddChannelUser(bot, channel);
change->args[1].mode = MODE_BAN;
- change->args[1].hostmask = "*!*@*";
+ change->args[1].u.hostmask = "*!*@*";
} else {
change = mod_chanmode_alloc(1);
change->args[0].mode = MODE_BAN;
- change->args[0].hostmask = "*!*@*";
+ change->args[0].u.hostmask = "*!*@*";
}
modcmd_chanmode_announce(change);
+ mod_chanmode_free(change);
if (argc < 2) {
reason = alloca(strlen(OSMSG_KICK_REQUESTED)+strlen(user->nick)+1);
sprintf(reason, OSMSG_KICK_REQUESTED, user->nick);
if (mn->modes & MODE_CHANOP)
continue;
change->args[count].mode = MODE_CHANOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
if (mn->modes & MODE_HALFOP)
continue;
change->args[count].mode = MODE_HALFOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
if (mn->modes & MODE_CHANOP)
continue;
change->args[count].mode = MODE_CHANOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
if (mn->modes & MODE_HALFOP)
continue;
change->args[count].mode = MODE_HALFOP;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
if (argv[1][0] == '*')
target = GetUserN(argv[1]+1);
else
- target = GetUserH(argv[1]);
-#else
- target = GetUserH(argv[1]);
#endif
+ target = GetUserH(argv[1]);
if (!target) {
reply("MSG_NICK_UNKNOWN", argv[1]);
return 0;
mod_chanmode_init(&change);
change.argc = 1;
change.args[0].mode = MODE_REMOVE | MODE_BAN;
- change.args[0].hostmask = argv[1];
+ change.args[0].u.hostmask = argv[1];
modcmd_chanmode_announce(&change);
reply("OSMSG_UNBAN_DONE", channel->name);
return 1;
if (mn->modes & (MODE_CHANOP|MODE_HALFOP|MODE_VOICE))
continue;
change->args[count].mode = MODE_VOICE;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
if (!(mn->modes & MODE_VOICE))
continue;
change->args[count].mode = MODE_REMOVE | MODE_VOICE;
- change->args[count++].member = mn;
+ change->args[count++].u.member = mn;
}
if (count) {
change->argc = count;
change = mod_chanmode_alloc(2);
change->modes_set = MODE_SECRET | MODE_INVITEONLY;
change->args[0].mode = MODE_CHANOP;
- change->args[0].member = AddChannelUser(opserv, channel);
+ change->args[0].u.member = AddChannelUser(opserv, channel);
change->args[1].mode = MODE_BAN;
- change->args[1].hostmask = "*!*@*";
+ change->args[1].u.hostmask = "*!*@*";
mod_chanmode_announce(opserv, channel, change);
mod_chanmode_free(change);
for (nn=channel->members.used; nn>0; ) {
if (!GetUserMode(channel, opserv)) {
/* If we aren't in the channel, join it. */
change.args[0].mode = MODE_CHANOP;
- change.args[0].member = AddChannelUser(opserv, channel);
+ change.args[0].u.member = AddChannelUser(opserv, channel);
change.argc++;
}
if (!(channel->modes & MODE_MODERATED))
mod_chanmode_init(&change);
change.argc = 1;
change.args[0].mode = MODE_CHANOP;
- change.args[0].member = GetUserMode(channel, clone);
- if (!change.args[0].member) {
+ change.args[0].u.member = GetUserMode(channel, clone);
+ if (!change.args[0].u.member) {
reply("OSMSG_NOT_ON_CHANNEL", clone->nick, channel->name);
return 0;
}
mod_chanmode_init(&change);
change.argc = 1;
change.args[0].mode = MODE_HALFOP;
- change.args[0].member = GetUserMode(channel, clone);
- if (!change.args[0].member) {
+ change.args[0].u.member = GetUserMode(channel, clone);
+ if (!change.args[0].u.member) {
reply("OSMSG_NOT_ON_CHANNEL", clone->nick, channel->name);
return 0;
}
init_opserv(const char *nick)
{
OS_LOG = log_register_type("OpServ", "file:opserv.log");
- if (nick)
- opserv = AddService(nick, "Oper Services", NULL);
+ if (nick) {
+ const char *modes = conf_get_data("services/opserv/modes", RECDB_QSTRING);
+ opserv = AddService(nick, modes ? modes : NULL, "Oper Services", NULL);
+ }
conf_register_reload(opserv_conf_read);
memset(level_strings, 0, sizeof(level_strings));