mirror of
https://github.com/anope/anope.git
synced 2026-07-01 13:26:39 +02:00
Fix some inconsistencies with account lookups.
This commit is contained in:
+2
-2
@@ -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);
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -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();
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user