diff options
author | Adam <Adam@anope.org> | 2017-10-07 21:10:47 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-10-07 21:10:47 -0400 |
commit | 2312f1fbd06ac01bb55e1d99070cde05a09a5a17 (patch) | |
tree | 69239628ed39e342650574f93d441f58d6d82b7b /modules/botserv/assign.cpp | |
parent | 286bffa2cd6a3f564334c5a4669ea3aadfb27a0a (diff) |
No longer expose c->ci and ci->c
Diffstat (limited to 'modules/botserv/assign.cpp')
-rw-r--r-- | modules/botserv/assign.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/modules/botserv/assign.cpp b/modules/botserv/assign.cpp index 26a448216..469f1f051 100644 --- a/modules/botserv/assign.cpp +++ b/modules/botserv/assign.cpp @@ -248,20 +248,22 @@ class BSAssign : public Module void OnInvite(User *source, Channel *c, User *targ) override { - ServiceBot *bi; - if (Anope::ReadOnly || !c->ci || targ->server != Me || !(bi = ServiceBot::Find(targ->nick, true))) + ServiceBot *bi = ServiceBot::Find(targ->nick, true); + ChanServ::Channel *ci = c->GetChannel(); + + if (Anope::ReadOnly || !ci || targ->server != Me || !bi) return; - ChanServ::AccessGroup access = c->ci->AccessFor(source); + ChanServ::AccessGroup access = ci->AccessFor(source); if (!access.HasPriv("ASSIGN") && !source->HasPriv("botserv/administration")) { - targ->SendMessage(bi, _("Access denied. You do not have privilege \002ASSIGN\002 on \002{0}\002."), c->ci->GetName()); + targ->SendMessage(bi, _("Access denied. You do not have privilege \002ASSIGN\002 on \002{0}\002."), ci->GetName()); return; } - if (nobot.HasExt(c->ci)) + if (nobot.HasExt(ci)) { - targ->SendMessage(bi, _("Access denied. \002{0}\002 may not have a bot assigned to it because a Services Operator has disallowed it."), c->ci->GetName()); + targ->SendMessage(bi, _("Access denied. \002{0}\002 may not have a bot assigned to it because a Services Operator has disallowed it."), ci->GetName()); return; } @@ -271,14 +273,14 @@ class BSAssign : public Module return; } - if (c->ci->GetBot() == bi) + if (ci->GetBot() == bi) { - targ->SendMessage(bi, _("Bot \002{0}\002 is already assigned to \002{1}\002."), bi->nick, c->ci->GetName()); + targ->SendMessage(bi, _("Bot \002{0}\002 is already assigned to \002{1}\002."), bi->nick, ci->GetName()); return; } - bi->Assign(source, c->ci); - targ->SendMessage(bi, _("Bot \002{0}\002 has been assigned to \002{1}\002."), bi->nick, c->ci->GetName()); + bi->Assign(source, ci); + targ->SendMessage(bi, _("Bot \002{0}\002 has been assigned to \002{1}\002."), bi->nick, ci->GetName()); } void OnServiceBot(CommandSource &source, ServiceBot *bi, ChanServ::Channel *ci, InfoFormatter &info) override |