From 96ccfe4cbe9948206ac2d6854778f9a268d2476f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 11 Nov 2024 16:46:56 +0000 Subject: Fix using User::Account where User::IsIdentified should be used. The former causes a dereference which cause a database update. This is not good for performance with db_sql_live on bigger networks. --- src/language.cpp | 2 +- src/memos.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/language.cpp b/src/language.cpp index b43d36a88..0e1e7e9a0 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -62,7 +62,7 @@ const char *Language::Translate(const char *string) const char *Language::Translate(User *u, const char *string) { - if (u && u->Account()) + if (u && u->IsIdentified()) return Translate(u->Account(), string); else return Translate("", string); diff --git a/src/memos.cpp b/src/memos.cpp index 141dcbb42..891b09aff 100644 --- a/src/memos.cpp +++ b/src/memos.cpp @@ -114,7 +114,7 @@ void MemoInfo::Del(unsigned index) bool MemoInfo::HasIgnore(User *u) { for (unsigned i = 0; i < this->ignores.size(); ++i) - if (u->nick.equals_ci(this->ignores[i]) || (u->Account() && u->Account()->display.equals_ci(this->ignores[i])) || Anope::Match(u->GetMask(), Anope::string(this->ignores[i]))) + if (u->nick.equals_ci(this->ignores[i]) || (u->IsIdentified() && u->Account()->display.equals_ci(this->ignores[i])) || Anope::Match(u->GetMask(), Anope::string(this->ignores[i]))) return true; return false; } -- cgit