summaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-25 03:09:51 -0500
committerAdam <Adam@anope.org>2013-01-25 03:09:51 -0500
commit76d9e58ae59ca99452ebaeedef661d0f82fc7104 (patch)
tree014661d8ceb6d422a7cafbd1a97ef3095fea04f4 /modules/commands
parent3769cc1a3597dd70e88c305540a61984db2626af (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/commands')
-rw-r--r--modules/commands/ms_cancel.cpp2
-rw-r--r--modules/commands/ms_ignore.cpp2
-rw-r--r--modules/commands/ms_rsend.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/modules/commands/ms_cancel.cpp b/modules/commands/ms_cancel.cpp
index 908c4ef96..e03883d91 100644
--- a/modules/commands/ms_cancel.cpp
+++ b/modules/commands/ms_cancel.cpp
@@ -34,7 +34,7 @@ class CommandMSCancel : public Command
const Anope::string &nname = params[0];
bool ischan;
- MemoInfo *mi = MemoServService->GetMemoInfo(nname, ischan);
+ MemoInfo *mi = MemoInfo::GetMemoInfo(nname, ischan);
if (mi == NULL)
source.Reply(ischan ? CHAN_X_NOT_REGISTERED : _(NICK_X_NOT_REGISTERED), nname.c_str());
diff --git a/modules/commands/ms_ignore.cpp b/modules/commands/ms_ignore.cpp
index ec56624b8..7caa30f88 100644
--- a/modules/commands/ms_ignore.cpp
+++ b/modules/commands/ms_ignore.cpp
@@ -44,7 +44,7 @@ class CommandMSIgnore : public Command
}
bool ischan;
- MemoInfo *mi = MemoServService->GetMemoInfo(channel, ischan);
+ MemoInfo *mi = MemoInfo::GetMemoInfo(channel, ischan);
ChannelInfo *ci = ChannelInfo::Find(channel);
if (!mi)
source.Reply(ischan ? CHAN_X_NOT_REGISTERED : _(NICK_X_NOT_REGISTERED), channel.c_str());
diff --git a/modules/commands/ms_rsend.cpp b/modules/commands/ms_rsend.cpp
index 19bd80437..fafcf5eff 100644
--- a/modules/commands/ms_rsend.cpp
+++ b/modules/commands/ms_rsend.cpp
@@ -63,7 +63,7 @@ class CommandMSRSend : public Command
source.Reply(_("Memo sent to \002%s\002."), name.c_str());
bool ischan;
- MemoInfo *mi = MemoServService->GetMemoInfo(nick, ischan);
+ MemoInfo *mi = MemoInfo::GetMemoInfo(nick, ischan);
if (mi == NULL)
throw CoreException("NULL mi in ms_rsend");
Memo *m = (mi->memos->size() ? mi->GetMemo(mi->memos->size() - 1) : NULL);