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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user