diff options
author | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
commit | 2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch) | |
tree | 36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/ms_list.cpp | |
parent | 873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff) |
Allow userless command sources
Diffstat (limited to 'modules/commands/ms_list.cpp')
-rw-r--r-- | modules/commands/ms_list.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/commands/ms_list.cpp b/modules/commands/ms_list.cpp index 1ba0644aa..f6a92e9df 100644 --- a/modules/commands/ms_list.cpp +++ b/modules/commands/ms_list.cpp @@ -24,7 +24,6 @@ class CommandMSList : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.u; Anope::string param = !params.empty() ? params[0] : "", chan; ChannelInfo *ci = NULL; @@ -41,7 +40,7 @@ class CommandMSList : public Command source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str()); return; } - else if (!ci->AccessFor(u).HasPriv("MEMO")) + else if (!source.AccessFor(ci).HasPriv("MEMO")) { source.Reply(ACCESS_DENIED); return; @@ -49,7 +48,7 @@ class CommandMSList : public Command mi = &ci->memos; } else - mi = &u->Account()->memos; + mi = &source.nc->memos; if (!param.empty() && !isdigit(param[0]) && !param.equals_ci("NEW")) this->OnSyntaxError(source, param); @@ -131,7 +130,7 @@ class CommandMSList : public Command std::vector<Anope::string> replies; list.Process(replies); - source.Reply(_("Memos for %s."), ci ? ci->name.c_str() : u->nick.c_str()); + source.Reply(_("Memos for %s."), ci ? ci->name.c_str() : source.GetNick().c_str()); for (unsigned i = 0; i < replies.size(); ++i) source.Reply(replies[i]); } |