diff options
author | Adam <Adam@anope.org> | 2013-08-01 13:16:18 +0000 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-08-01 13:39:35 +0000 |
commit | 1e625b6837fdf96616cfc49700aa28d184a7c171 (patch) | |
tree | 6b6f06deaf769dd6b1a7853f90d26183828986f1 /modules/commands | |
parent | 402c624e455d13cc811bef2e8d1639846e892a34 (diff) |
Use MessageSource as the source for many IRCDProto funcs
Keep track of what user modes are oper only/server only/etc
Diffstat (limited to 'modules/commands')
-rw-r--r-- | modules/commands/bs_control.cpp | 4 | ||||
-rw-r--r-- | modules/commands/cs_seen.cpp | 2 | ||||
-rw-r--r-- | modules/commands/greet.cpp | 2 | ||||
-rw-r--r-- | modules/commands/ns_register.cpp | 4 | ||||
-rw-r--r-- | modules/commands/ns_resetpass.cpp | 4 | ||||
-rw-r--r-- | modules/commands/ns_set.cpp | 2 | ||||
-rw-r--r-- | modules/commands/ns_set_misc.cpp | 2 | ||||
-rw-r--r-- | modules/commands/os_defcon.cpp | 2 | ||||
-rw-r--r-- | modules/commands/os_news.cpp | 2 | ||||
-rw-r--r-- | modules/commands/os_noop.cpp | 2 | ||||
-rw-r--r-- | modules/commands/os_svs.cpp | 4 |
11 files changed, 16 insertions, 14 deletions
diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 94186c13b..c0f702a94 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -55,7 +55,7 @@ class CommandBSSay : public Command return; } - IRCD->SendPrivmsg(ci->bi, ci->name, "%s", text.c_str()); + IRCD->SendPrivmsg(*ci->bi, ci->name, "%s", text.c_str()); ci->bi->lastmsg = Anope::CurTime; bool override = !source.AccessFor(ci).HasPriv("SAY"); @@ -113,7 +113,7 @@ class CommandBSAct : public Command if (message.empty()) return; - IRCD->SendAction(ci->bi, ci->name, "%s", message.c_str()); + IRCD->SendAction(*ci->bi, ci->name, "%s", message.c_str()); ci->bi->lastmsg = Anope::CurTime; bool override = !source.AccessFor(ci).HasPriv("SAY"); diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index 7fa7d3c7a..c3f40c799 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -351,7 +351,7 @@ class CSSeen : public Module UpdateUser(u, PART, u->nick, "", channel, msg); } - void OnPreUserKicked(MessageSource &source, ChanUserContainer *cu, const Anope::string &msg) anope_override + void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &msg) anope_override { UpdateUser(cu->user, KICK, cu->user->nick, source.GetSource(), cu->chan->name, msg); } diff --git a/modules/commands/greet.cpp b/modules/commands/greet.cpp index dd3fce66f..90f263557 100644 --- a/modules/commands/greet.cpp +++ b/modules/commands/greet.cpp @@ -188,7 +188,7 @@ class Greet : public Module Anope::string *greet = ns_greet.Get(user->Account()); if (bs_greet.HasExt(c->ci) && greet != NULL && !greet->empty() && c->FindUser(c->ci->bi) && c->ci->AccessFor(user).HasPriv("GREET")) { - IRCD->SendPrivmsg(c->ci->bi, c->name, "[%s] %s", user->Account()->display.c_str(), greet->c_str()); + IRCD->SendPrivmsg(*c->ci->bi, c->name, "[%s] %s", user->Account()->display.c_str(), greet->c_str()); c->ci->bi->lastmsg = Anope::CurTime; } } diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index fd19590e8..abe3d314b 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -11,7 +11,7 @@ #include "module.h" -static bool SendRegmail(User *u, const NickAlias *na, const BotInfo *bi); +static bool SendRegmail(User *u, const NickAlias *na, BotInfo *bi); class CommandNSConfirm : public Command { @@ -381,7 +381,7 @@ class NSRegister : public Module } }; -static bool SendRegmail(User *u, const NickAlias *na, const BotInfo *bi) +static bool SendRegmail(User *u, const NickAlias *na, BotInfo *bi) { NickCore *nc = na->nc; diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index 871864b6d..6af3af0c2 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -11,7 +11,7 @@ #include "module.h" -static bool SendResetEmail(User *u, const NickAlias *na, const BotInfo *bi); +static bool SendResetEmail(User *u, const NickAlias *na, BotInfo *bi); class CommandNSResetPass : public Command { @@ -112,7 +112,7 @@ class NSResetPass : public Module } }; -static bool SendResetEmail(User *u, const NickAlias *na, const BotInfo *bi) +static bool SendResetEmail(User *u, const NickAlias *na, BotInfo *bi) { int min = 1, max = 62; int chars[] = { diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index df35f0582..83c03924d 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -367,7 +367,7 @@ class CommandNSSASetDisplay : public CommandNSSetDisplay class CommandNSSetEmail : public Command { - static bool SendConfirmMail(User *u, const BotInfo *bi, const Anope::string &new_email) + static bool SendConfirmMail(User *u, BotInfo *bi, const Anope::string &new_email) { int chars[] = { ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index 6ea3ab71b..45a857474 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -65,6 +65,8 @@ struct NSMiscData : Serializable ExtensibleItem<NSMiscData> *item = GetItem(sname); if (item) d = item->Set(nc, NSMiscData(nc, sname, sdata)); + else + d = NULL; } return d; diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index 58d18558b..1a335bc04 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -284,7 +284,7 @@ class OSDefcon : public Module if ((cm = ModeManager::FindChannelModeByChar(mode))) { - if (cm->type == MODE_STATUS || cm->type == MODE_LIST || !cm->CanSet(NULL)) + if (cm->type == MODE_STATUS || cm->type == MODE_LIST) { Log(this) << "DefConChanModes mode character '" << mode << "' cannot be locked"; continue; diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index cb6a9fcfa..bdff3c5eb 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -387,7 +387,7 @@ class OSNews : public Module { } - void OnUserModeSet(User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override { if (mname == "OPER") DisplayNews(u, NEWS_OPER); diff --git a/modules/commands/os_noop.cpp b/modules/commands/os_noop.cpp index 0b5dc74d9..cae4d6f68 100644 --- a/modules/commands/os_noop.cpp +++ b/modules/commands/os_noop.cpp @@ -85,7 +85,7 @@ class OSNOOP : public Module } - void OnUserModeSet(User *u, const Anope::string &mname) anope_override + void OnUserModeSet(const MessageSource &, User *u, const Anope::string &mname) anope_override { Anope::string *setter; if (mname == "OPER" && (setter = noop.Get(u->server))) diff --git a/modules/commands/os_svs.cpp b/modules/commands/os_svs.cpp index 4e9a31e6b..1c492579c 100644 --- a/modules/commands/os_svs.cpp +++ b/modules/commands/os_svs.cpp @@ -99,7 +99,7 @@ class CommandOSSVSJoin : public Command source.Reply(_("\002%s\002 is already in \002%s\002."), target->nick.c_str(), c->name.c_str()); else { - IRCD->SendSVSJoin(source.service, target, params[1], ""); + IRCD->SendSVSJoin(*source.service, target, params[1], ""); Log(LOG_ADMIN, source, this) << "to force " << target->nick << " to join " << params[1]; source.Reply(_("\002%s\002 has been joined to \002%s\002."), target->nick.c_str(), params[1].c_str()); } @@ -143,7 +143,7 @@ class CommandOSSVSPart : public Command source.Reply(_("\002%s\002 is not in \002%s\002."), target->nick.c_str(), c->name.c_str()); else { - IRCD->SendSVSPart(source.service, target, params[1], ""); + IRCD->SendSVSPart(*source.service, target, params[1], ""); Log(LOG_ADMIN, source, this) << "to force " << target->nick << " to part " << c->name; source.Reply(_("\002%s\002 has been parted from \002%s\002."), target->nick.c_str(), c->name.c_str()); } |