summaryrefslogtreecommitdiff
path: root/modules/commands/ms_info.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-05-28 12:07:29 -0400
committerAdam <Adam@anope.org>2014-05-28 12:07:54 -0400
commitf29e1cf383529a1a29f02b0669d973f5ee0b7a66 (patch)
tree3c33db276dc9328235bbd572641521ed44458176 /modules/commands/ms_info.cpp
parent1253c70e0682fa1490c99c3d2869049a0e3fa2e0 (diff)
Move most of the core pseudoclient logic to modules
Diffstat (limited to 'modules/commands/ms_info.cpp')
-rw-r--r--modules/commands/ms_info.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/commands/ms_info.cpp b/modules/commands/ms_info.cpp
index 0e7506765..9544be3c7 100644
--- a/modules/commands/ms_info.cpp
+++ b/modules/commands/ms_info.cpp
@@ -22,27 +22,27 @@ class CommandMSInfo : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
- NickCore *nc = source.nc;
- const MemoInfo *mi;
- const NickAlias *na = NULL;
- ChannelInfo *ci = NULL;
+ NickServ::Account *nc = source.nc;
+ const MemoServ::MemoInfo *mi;
+ const NickServ::Nick *na = NULL;
+ ChanServ::Channel *ci = NULL;
const Anope::string &nname = !params.empty() ? params[0] : "";
bool hardmax;
if (!nname.empty() && nname[0] != '#' && source.HasPriv("memoserv/info"))
{
- na = NickAlias::Find(nname);
+ na = NickServ::FindNick(nname);
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, nname.c_str());
return;
}
- mi = &na->nc->memos;
+ mi = na->nc->memos;
hardmax = na->nc->HasExt("MEMO_HARDMAX");
}
else if (!nname.empty() && nname[0] == '#')
{
- ci = ChannelInfo::Find(nname);
+ ci = ChanServ::Find(nname);
if (!ci)
{
source.Reply(CHAN_X_NOT_REGISTERED, nname.c_str());
@@ -53,7 +53,7 @@ class CommandMSInfo : public Command
source.Reply(ACCESS_DENIED);
return;
}
- mi = &ci->memos;
+ mi = ci->memos;
hardmax = ci->HasExt("MEMO_HARDMAX");
}
else if (!nname.empty()) /* It's not a chan and we aren't services admin */
@@ -63,9 +63,11 @@ class CommandMSInfo : public Command
}
else
{
- mi = &nc->memos;
+ mi = nc->memos;
hardmax = nc->HasExt("MEMO_HARDMAX");
}
+ if (!mi)
+ return;
if (!nname.empty() && (ci || na->nc != nc))
{