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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user