From 792091b23c4c0f442cec27dc7e314079d1618498 Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Fri, 2 Nov 2012 18:35:33 +0100 Subject: [PATCH] cs_seen: do not read duplicate SeenInfo entries from the database --- modules/commands/cs_seen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index c3d04cf55..cbbd1c35c 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -20,6 +20,7 @@ enum TypeInfo }; struct SeenInfo; +static SeenInfo *FindInfo(const Anope::string &nick); typedef Anope::insensitive_map database_map; database_map database; @@ -58,7 +59,12 @@ struct SeenInfo : Serializable if (obj) s = anope_dynamic_static_cast(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;