summaryrefslogtreecommitdiff
path: root/src/memoserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-07 20:51:41 -0500
committerAdam <Adam@anope.org>2010-12-12 19:31:00 -0500
commitac41137ce2741df8faf539e0655a10cd4a8f7e32 (patch)
treeee4fc88bba9eeb24bd6802533d42df05e9ee9e75 /src/memoserv.cpp
parent28aba58e250fd6d58b0dff3bbc9ee8bbe172df24 (diff)
Added /ms ignore
Diffstat (limited to 'src/memoserv.cpp')
-rw-r--r--src/memoserv.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/memoserv.cpp b/src/memoserv.cpp
index ac455257f..eac54cc6d 100644
--- a/src/memoserv.cpp
+++ b/src/memoserv.cpp
@@ -211,6 +211,11 @@ void memo_send(User *u, const Anope::string &name, const Anope::string &text, in
}
else
{
+ if (!z || z == 3)
+ u->SendMessage(MemoServ, MEMO_SENT, name.c_str());
+ if ((!u->Account() || !u->Account()->IsServicesOper()) && mi->HasIgnore(u))
+ return;
+
u->lastmemosend = Anope::CurTime;
Memo *m = new Memo();
mi->memos.push_back(m);
@@ -224,8 +229,6 @@ void memo_send(User *u, const Anope::string &name, const Anope::string &text, in
/* Set receipt request flag */
if (z == 3)
m->SetFlag(MF_RECEIPT);
- if (!z || z == 3)
- u->SendMessage(MemoServ, MEMO_SENT, name.c_str());
if (!ischan)
{
NickCore *nc = findnick(name)->nc;
@@ -307,6 +310,14 @@ void MemoInfo::Del(Memo *memo)
}
}
+bool MemoInfo::HasIgnore(User *u)
+{
+ for (unsigned i = 0; i < this->ignores.size(); ++i)
+ if (u->nick.equals_ci(this->ignores[i]) || (u->Account() && u->Account()->display.equals_ci(this->ignores[i])) || Anope::Match(u->GetMask(), Anope::string(this->ignores[i])))
+ return true;
+ return false;
+}
+
/*************************************************************************/
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)