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

Reference accounts in the database by their id not their nick.

This commit is contained in:
Sadie Powell
2025-03-30 11:39:48 +01:00
parent 8d3b8c08b3
commit 0802d9d3ff
3 changed files with 24 additions and 15 deletions
+5 -3
View File
@@ -55,7 +55,7 @@ struct AJoinEntryType final
if (!aj->owner)
return;
data.Store("owner", aj->owner->display);
data.Store("ownerid", aj->owner->GetId());
data.Store("channel", aj->channel);
data.Store("key", aj->key);
}
@@ -63,10 +63,12 @@ struct AJoinEntryType final
Serializable *Unserialize(Serializable *obj, Serialize::Data &sd) const override
{
Anope::string sowner;
uint64_t sownerid = 0;
sd["owner"] >> sowner;
sd["owner"] >> sowner; // Deprecated 2.0 field
sd["ownerid"] >> sownerid;
NickCore *nc = NickCore::Find(sowner);
auto *nc = sownerid ? NickCore::FindId(sownerid) : NickCore::Find(sowner);
if (nc == NULL)
return NULL;