diff options
author | Adam <Adam@anope.org> | 2013-09-23 13:20:32 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-09-27 19:11:02 -0400 |
commit | cf653fc08429054e5451482166622fc8db8fec1f (patch) | |
tree | 0731f60efddf5a34d2374ec2ab0c6043aebbad7e | |
parent | 5cc7fc03871018f26fe929852c03fb28296aa017 (diff) |
Fix ms del all not actually deleting some memos
Fix numbering of memos in ms list
-rw-r--r-- | modules/commands/ms_del.cpp | 5 | ||||
-rw-r--r-- | modules/commands/ms_list.cpp | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index 8876f1d31..a3ac928a7 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -100,12 +100,11 @@ class CommandMSDel : public Command else { /* Delete all memos. */ - for (unsigned i = 0, end = mi->memos->size(); i < end; ++i) + for (unsigned i = mi->memos->size(); i > 0; --i) { FOREACH_MOD(OnMemoDel, (ci ? ci->name : source.nc->display, mi, mi->GetMemo(i))); - delete mi->GetMemo(i); + mi->Del(i - 1); } - mi->memos->clear(); if (!chan.empty()) source.Reply(_("All memos for channel %s have been deleted."), chan.c_str()); else diff --git a/modules/commands/ms_list.cpp b/modules/commands/ms_list.cpp index c0c69eb4f..1671c5c08 100644 --- a/modules/commands/ms_list.cpp +++ b/modules/commands/ms_list.cpp @@ -83,7 +83,7 @@ class CommandMSList : public Command const Memo *m = mi->GetMemo(number - 1); ListFormatter::ListEntry entry; - entry["Number"] = (m->unread ? "* " : " ") + stringify(number + 1); + entry["Number"] = (m->unread ? "* " : " ") + stringify(number); entry["Sender"] = m->sender; entry["Date/Time"] = Anope::strftime(m->time, source.GetAccount()); this->list.AddEntry(entry); |