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_read.cpp | |
parent | 873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff) |
Allow userless command sources
Diffstat (limited to 'modules/commands/ms_read.cpp')
-rw-r--r-- | modules/commands/ms_read.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/commands/ms_read.cpp b/modules/commands/ms_read.cpp index 341d8f828..5b46ef0dd 100644 --- a/modules/commands/ms_read.cpp +++ b/modules/commands/ms_read.cpp @@ -36,7 +36,7 @@ static void rsend_notify(CommandSource &source, MemoInfo *mi, Memo *m, const Ano Anope::string text = Anope::printf(translate(na->nc, _("\002[auto-memo]\002 The memo you sent to %s has been viewed.")), targ.c_str()); /* Send notification */ - memoserv->Send(source.u->nick, m->sender, text, true); + memoserv->Send(source.GetNick(), m->sender, text, true); /* Notify recepient of the memo that a notification has been sent to the sender */ @@ -78,7 +78,7 @@ class MemoListCallback : public NumberList /* Check if a receipt notification was requested */ if (m->HasFlag(MF_RECEIPT)) - rsend_notify(source, mi, m, ci ? ci->name : source.u->nick); + rsend_notify(source, mi, m, ci ? ci->name : source.GetNick()); } }; @@ -93,7 +93,6 @@ class CommandMSRead : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.u; MemoInfo *mi; ChannelInfo *ci = NULL; @@ -110,7 +109,7 @@ class CommandMSRead : 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; @@ -118,7 +117,7 @@ class CommandMSRead : public Command mi = &ci->memos; } else - mi = const_cast<MemoInfo *>(&u->Account()->memos); + mi = const_cast<MemoInfo *>(&source.nc->memos); if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && !numstr.is_number_only())) this->OnSyntaxError(source, numstr); |