diff options
author | Sadie Powell <sadie@witchery.services> | 2025-05-17 15:05:13 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-05-17 19:35:03 +0100 |
commit | d3bb930a5e70dbaacfc42128472b84066f42f5db (patch) | |
tree | 35ace4c5e57b77211d13e6be7a3ce4565be7f7c1 | |
parent | 0fc1eb313369a0b50c6a7f246966bec72a63ed69 (diff) |
Fix some inconsistencies with account lookups.
-rw-r--r-- | include/account.h | 4 | ||||
-rw-r--r-- | src/nickalias.cpp | 4 | ||||
-rw-r--r-- | src/nickcore.cpp | 12 | ||||
-rw-r--r-- | src/regchannel.cpp | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/include/account.h b/include/account.h index 6f8bed01b..d42d6d671 100644 --- a/include/account.h +++ b/include/account.h @@ -113,7 +113,7 @@ public: * @return the nick, if found */ static NickAlias *Find(const Anope::string &nick); - static NickAlias *FindId(uint64_t id); + static NickAlias *FindId(uint64_t uid); }; /* A registered account. Each account must have a NickAlias with the same nick as the @@ -195,7 +195,7 @@ public: * @return The account, if it exists */ static NickCore *Find(const Anope::string &nick); - static NickCore *FindId(uint64_t id); + static NickCore *FindId(uint64_t uid); void AddChannelReference(ChannelInfo *ci); void RemoveChannelReference(ChannelInfo *ci); diff --git a/src/nickalias.cpp b/src/nickalias.cpp index a0adcc378..eae218f1e 100644 --- a/src/nickalias.cpp +++ b/src/nickalias.cpp @@ -139,9 +139,9 @@ NickAlias *NickAlias::Find(const Anope::string &nick) return NULL; } -NickAlias *NickAlias::FindId(uint64_t id) +NickAlias *NickAlias::FindId(uint64_t uid) { - const auto *nc = NickCore::FindId(id); + const auto *nc = NickCore::FindId(uid); return nc ? nc->na : nullptr; } diff --git a/src/nickcore.cpp b/src/nickcore.cpp index 3f79dbf12..8f81382ad 100644 --- a/src/nickcore.cpp +++ b/src/nickcore.cpp @@ -32,8 +32,8 @@ NickCore::NickCore(const Anope::string &coredisplay, uint64_t coreid) Log(LOG_DEBUG) << "Duplicate account " << this->display << " in NickCore table"; // Upgrading users may not have an account identifier. - if (this->id && !NickCoreIdList->insert_or_assign(this->id, this).second) - Log(LOG_DEBUG) << "Duplicate account id " << this->id << " in NickCore table"; + if (this->uniqueid && !NickCoreIdList->insert_or_assign(this->uniqueid, this).second) + Log(LOG_DEBUG) << "Duplicate account id " << this->uniqueid << " in NickCore table"; FOREACH_MOD(OnNickCoreCreate, (this)); } @@ -55,8 +55,8 @@ NickCore::~NickCore() this->users.clear(); NickCoreList->erase(this->display); - if (this->id) - NickCoreIdList->erase(this->id); + if (this->uniqueid) + NickCoreIdList->erase(this->uniqueid); if (!this->memos.memos->empty()) { @@ -244,9 +244,9 @@ NickCore *NickCore::Find(const Anope::string &nick) return NULL; } -NickCore *NickCore::FindId(uint64_t id) +NickCore *NickCore::FindId(uint64_t uid) { - auto it = NickCoreIdList->find(id); + auto it = NickCoreIdList->find(uid); if (it != NickCoreIdList->end()) { it->second->QueueUpdate(); diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 73fb82d7f..dd45bc48e 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -78,7 +78,7 @@ Serializable *AutoKick::Type::Unserialize(Serializable *obj, Serialize::Data &da ak = anope_dynamic_static_cast<AutoKick *>(obj); data["creator"] >> ak->creator; data["reason"] >> ak->reason; - ak->nc = NickCore::Find(snc); + ak->nc = nc; data["mask"] >> ak->mask; data["addtime"] >> ak->addtime; data["last_used"] >> ak->last_used; |