summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/coremods/core_oper/core_oper.cpp15
-rw-r--r--src/users.cpp11
2 files changed, 15 insertions, 11 deletions
diff --git a/src/coremods/core_oper/core_oper.cpp b/src/coremods/core_oper/core_oper.cpp
index be4b87714..dba34cc6b 100644
--- a/src/coremods/core_oper/core_oper.cpp
+++ b/src/coremods/core_oper/core_oper.cpp
@@ -55,6 +55,21 @@ class CoreModOper : public Module
cmdkill.hideuline = security->getBool("hideulinekills");
}
+ void OnPostOper(User* user, const std::string&, const std::string&) CXX11_OVERRIDE
+ {
+ LocalUser* luser = IS_LOCAL(user);
+ if (luser)
+ return;
+
+ const std::string vhost = luser->oper->getConfig("vhost");
+ if (!vhost.empty())
+ luser->ChangeDisplayedHost(vhost);
+
+ const std::string klass = luser->oper->getConfig("class");
+ if (!klass.empty())
+ luser->SetClass(klass);
+ }
+
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides the DIE, KILL, OPER, REHASH, and RESTART commands", VF_VENDOR | VF_CORE);
diff --git a/src/users.cpp b/src/users.cpp
index b00992141..582abe17e 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -377,17 +377,6 @@ void User::Oper(OperInfo* info)
if (info->oper_block)
opername = info->oper_block->getString("name");
- if (IS_LOCAL(this))
- {
- LocalUser* l = IS_LOCAL(this);
- std::string vhost = oper->getConfig("vhost");
- if (!vhost.empty())
- l->ChangeDisplayedHost(vhost);
- std::string opClass = oper->getConfig("class");
- if (!opClass.empty())
- l->SetClass(opClass);
- }
-
ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')",
nick.c_str(), ident.c_str(), GetRealHost().c_str(), oper->name.c_str(), opername.c_str());
this->WriteNumeric(RPL_YOUAREOPER, InspIRCd::Format("You are now %s %s", strchr("aeiouAEIOU", oper->name[0]) ? "an" : "a", oper->name.c_str()));