summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/memoserv/memoinfo.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/pseudoclients/memoserv/memoinfo.cpp
parent1253c70e0682fa1490c99c3d2869049a0e3fa2e0 (diff)
Move most of the core pseudoclient logic to modules
Diffstat (limited to 'modules/pseudoclients/memoserv/memoinfo.cpp')
-rw-r--r--modules/pseudoclients/memoserv/memoinfo.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/pseudoclients/memoserv/memoinfo.cpp b/modules/pseudoclients/memoserv/memoinfo.cpp
new file mode 100644
index 000000000..a51cd4e6a
--- /dev/null
+++ b/modules/pseudoclients/memoserv/memoinfo.cpp
@@ -0,0 +1,33 @@
+#include "memoinfo.h"
+
+MemoServ::Memo *MemoInfoImpl::GetMemo(unsigned index) const
+{
+ if (index >= this->memos->size())
+ return NULL;
+ MemoServ::Memo *m = (*memos)[index];
+ m->QueueUpdate();
+ return m;
+}
+
+unsigned MemoInfoImpl::GetIndex(MemoServ::Memo *m) const
+{
+ for (unsigned i = 0; i < this->memos->size(); ++i)
+ if (this->GetMemo(i) == m)
+ return i;
+ return -1;
+}
+
+void MemoInfoImpl::Del(unsigned index)
+{
+ if (index >= this->memos->size())
+ return;
+ delete this->GetMemo(index);
+}
+
+bool MemoInfoImpl::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;
+}