diff options
| author | Adam <Adam@anope.org> | 2013-01-25 03:09:51 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-01-25 03:09:51 -0500 |
| commit | 76d9e58ae59ca99452ebaeedef661d0f82fc7104 (patch) | |
| tree | 014661d8ceb6d422a7cafbd1a97ef3095fea04f4 /modules/pseudoclients | |
| parent | 3769cc1a3597dd70e88c305540a61984db2626af (diff) | |
mysql_insert_id doesn't return an id if one isnt generated, so
check that it really returns a value before using it.
Also fix memos to cleanup after themselves when deleted.
Diffstat (limited to 'modules/pseudoclients')
| -rw-r--r-- | modules/pseudoclients/memoserv.cpp | 22 | ||||
| -rw-r--r-- | modules/pseudoclients/memoserv.h | 7 |
2 files changed, 1 insertions, 28 deletions
diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index 17aaaa308..ca54f3378 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -39,30 +39,10 @@ class MyMemoServService : public MemoServService public: MyMemoServService(Module *m) : MemoServService(m) { } - MemoInfo *GetMemoInfo(const Anope::string &target, bool &ischan) anope_override - { - if (!target.empty() && target[0] == '#') - { - ischan = true; - ChannelInfo *ci = ChannelInfo::Find(target); - if (ci != NULL) - return &ci->memos; - } - else - { - ischan = false; - NickAlias *na = NickAlias::Find(target); - if (na != NULL) - return &na->nc->memos; - } - - return NULL; - } - MemoResult Send(const Anope::string &source, const Anope::string &target, const Anope::string &message, bool force) anope_override { bool ischan; - MemoInfo *mi = this->GetMemoInfo(target, ischan); + MemoInfo *mi = MemoInfo::GetMemoInfo(target, ischan); if (mi == NULL) return MEMO_INVALID_TARGET; diff --git a/modules/pseudoclients/memoserv.h b/modules/pseudoclients/memoserv.h index e314c7208..71ca064de 100644 --- a/modules/pseudoclients/memoserv.h +++ b/modules/pseudoclients/memoserv.h @@ -14,13 +14,6 @@ class MemoServService : public Service MemoServService(Module *m) : Service(m, "MemoServService", "MemoServ") { } - /** Retrieve the memo info for a nick or channel - * @param target Target - * @param ischan Set to true if target is a channel - * @return A memoinfo structure or NULL - */ - virtual MemoInfo *GetMemoInfo(const Anope::string &target, bool &ischan) = 0; - /** Sends a memo. * @param source The source of the memo, can be anythin. * @param target The target of the memo, nick or channel. |
