1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 16:53:13 +02:00

Reworked live SQL support yet again

This commit is contained in:
Adam
2012-04-23 05:08:26 -04:00
parent 63c639e108
commit 573e49a7ea
172 changed files with 2517 additions and 2217 deletions
+7 -7
View File
@@ -30,28 +30,28 @@ class CommandMSCheck : public Command
bool found = false;
NickAlias *na = findnick(recipient);
const NickAlias *na = findnick(recipient);
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, recipient.c_str());
return;
}
MemoInfo *mi = &na->nc->memos;
MemoInfo *mi = const_cast<MemoInfo *>(&na->nc->memos);
/* Okay, I know this looks strange but we wanna get the LAST memo, so we
have to loop backwards */
for (int i = mi->memos.size() - 1; i >= 0; --i)
for (int i = mi->memos->size() - 1; i >= 0; --i)
{
if (u->Account()->display.equals_ci(mi->memos[i]->sender))
if (u->Account()->display.equals_ci(mi->GetMemo(i)->sender))
{
found = true; /* Yes, we've found the memo */
if (mi->memos[i]->HasFlag(MF_UNREAD))
source.Reply(_("The last memo you sent to %s (sent on %s) has not yet been read."), na->nick.c_str(), do_strftime(mi->memos[i]->time).c_str());
if (mi->GetMemo(i)->HasFlag(MF_UNREAD))
source.Reply(_("The last memo you sent to %s (sent on %s) has not yet been read."), na->nick.c_str(), do_strftime(mi->GetMemo(i)->time).c_str());
else
source.Reply(_("The last memo you sent to %s (sent on %s) has been read."), na->nick.c_str(), do_strftime(mi->memos[i]->time).c_str());
source.Reply(_("The last memo you sent to %s (sent on %s) has been read."), na->nick.c_str(), do_strftime(mi->GetMemo(i)->time).c_str());
break;
}
}