1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 13:36:38 +02:00

Fix ms del all not actually deleting some memos

Fix numbering of memos in ms list
This commit is contained in:
Adam
2013-09-23 13:20:32 -04:00
parent 5cc7fc0387
commit cf653fc084
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -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
+1 -1
View File
@@ -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);