1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 03:46:36 +02:00

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.
This commit is contained in:
Sadie Powell
2024-11-11 16:46:56 +00:00
parent ee160842b3
commit 96ccfe4cbe
20 changed files with 26 additions and 26 deletions
+2 -2
View File
@@ -108,7 +108,7 @@ void IRC2SQL::OnUserConnect(User *u, bool &exempt)
query.SetValue("ident", u->GetIdent());
query.SetValue("vident", u->GetVIdent());
query.SetValue("secure", u->HasMode("SSL") || u->HasExt("ssl") ? "Y" : "N");
query.SetValue("account", u->Account() ? u->Account()->display : "");
query.SetValue("account", u->IsIdentified() ? u->Account()->display : "");
query.SetValue("fingerprint", u->fingerprint);
query.SetValue("signon", u->signon);
query.SetValue("server", u->server->GetName());
@@ -176,7 +176,7 @@ void IRC2SQL::OnUserLogin(User *u)
{
query = "UPDATE `" + prefix + "user` SET account=@account@ WHERE nick=@nick@";
query.SetValue("nick", u->nick);
query.SetValue("account", u->Account() ? u->Account()->display : "");
query.SetValue("account", u->IsIdentified() ? u->Account()->display : "");
this->RunQuery(query);
}