aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_sqloper.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-08 13:48:44 +0000
committerGravatar Sadie Powell2023-01-08 13:48:44 +0000
commit94740c6252c025eede6091da7413f813692ac1d1 (patch)
tree9dcae31976b2f795915f0e2a0d89d0f152c328bd /src/modules/m_sqloper.cpp
parentMerge branch 'insp3' into master. (diff)
Switch sqloper to use a local user lookup instead of IS_LOCAL.
Diffstat (limited to 'src/modules/m_sqloper.cpp')
-rw-r--r--src/modules/m_sqloper.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp
index 130397a09..20bf8596f 100644
--- a/src/modules/m_sqloper.cpp
+++ b/src/modules/m_sqloper.cpp
@@ -119,11 +119,9 @@ public:
// Call /oper after placing all blocks from the SQL table into the Config->OperAccounts list.
void OperExec()
{
- auto user = ServerInstance->Users.Find(uid);
- LocalUser* localuser = IS_LOCAL(user);
- // This should never be true
- if (!localuser)
- return;
+ auto user = ServerInstance->Users.Find<LocalUser>(uid);
+ if (!user)
+ return; // The user disconnected before the SQL query returned.
Command* oper_command = ServerInstance->Parser.GetHandler("OPER");
@@ -137,7 +135,7 @@ public:
ModResult MOD_RESULT;
std::string origin = "OPER";
- FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (origin, params, localuser, true));
+ FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (origin, params, user, true));
if (MOD_RESULT == MOD_RES_DENY)
return;