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

cs_seen: do not read duplicate SeenInfo entries from the database

This commit is contained in:
DukePyrolator
2012-11-02 18:35:33 +01:00
parent b917361de8
commit 792091b23c
+7 -1
View File
@@ -20,6 +20,7 @@ enum TypeInfo
};
struct SeenInfo;
static SeenInfo *FindInfo(const Anope::string &nick);
typedef Anope::insensitive_map<SeenInfo *> database_map;
database_map database;
@@ -58,7 +59,12 @@ struct SeenInfo : Serializable
if (obj)
s = anope_dynamic_static_cast<SeenInfo *>(obj);
else
s = new SeenInfo();
{
/* ignore duplicate entries in the db, created by an old bug */
s = FindInfo(data["nick"].str());
if (!s)
s = new SeenInfo();
}
data["nick"] >> s->nick;
data["vhost"] >> s->vhost;