summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-09 05:26:10 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-09 05:26:10 +0000
commitfaed18f6e81c241b7d3ccc95d86ade44f46bd94f (patch)
tree43514f7b4f2ab416d2d2207d246e3a8eb0154a6f /src
parentce79b5023fee2bf0f2cd657a4fb5be7df1b5eb18 (diff)
Fixed loading memo messages from the flatfile databases
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2806 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/core/db_plain.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp
index ff2a4cdf3..e6da0a7b4 100644
--- a/src/core/db_plain.cpp
+++ b/src/core/db_plain.cpp
@@ -67,6 +67,7 @@ static void ReadDatabase(Module *m = NULL)
params.push_back(buf + " " + sep.GetRemaining());
else if (!buf.empty())
params.push_back(buf);
+ break;
}
else
params.push_back(buf);
@@ -566,8 +567,7 @@ class DBPlain : public Module
m->number = atoi(params[0].c_str());
m->time = strtol(params[1].c_str(), NULL, 10);
m->sender = params[2];
- unsigned j;
- for (j = 3; (params[j] == "UNREAD" || params[j] == "RECEIPT" || params[j] == "NOTIFYS"); ++j)
+ for (unsigned j = 3; (params[j] == "UNREAD" || params[j] == "RECEIPT" || params[j] == "NOTIFYS"); ++j)
{
if (params[j] == "UNREAD")
m->SetFlag(MF_UNREAD);
@@ -576,7 +576,7 @@ class DBPlain : public Module
else if (params[j] == "NOTIFYS")
m->SetFlag(MF_NOTIFYS);
}
- m->text = sstrdup(params[j + 1].c_str());
+ m->text = sstrdup(params[params.size() - 1].c_str());
nc->memos.memos.push_back(m);
}
@@ -743,8 +743,7 @@ class DBPlain : public Module
m->number = atoi(params[0].c_str());
m->time = strtol(params[1].c_str(), NULL, 10);
m->sender = params[2];
- unsigned j;
- for (j = 3; j < params.size() - 1 && (buf == "UNREAD" || buf == "RECEIPT" || buf == "NOTIFYS"); ++j)
+ for (unsigned j = 3; (params[j] == "UNREAD" || params[j] == "RECEIPT" || params[j] == "NOTIFYS"); ++j)
{
if (params[j] == "UNREAD")
m->SetFlag(MF_UNREAD);
@@ -753,7 +752,7 @@ class DBPlain : public Module
else if (params[j] == "NOTIFYS")
m->SetFlag(MF_NOTIFYS);
}
- m->text = sstrdup(params[j + 1].c_str());
+ m->text = sstrdup(params[params.size() - 1].c_str());
ci->memos.memos.push_back(m);
}
else if (key == "ENTRYMSG")