summaryrefslogtreecommitdiff
path: root/src/modules/m_operprefix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_operprefix.cpp')
-rw-r--r--src/modules/m_operprefix.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index a55bcf240..5991536e5 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -116,8 +116,8 @@ class ModuleOperPrefixMode : public Module
if ((!ServerInstance->Modes->AddMode(opm)))
throw ModuleException("Could not add a new mode!");
- Implementation eventlist[] = { I_OnPostJoin, I_OnCleanup, I_OnUserQuit, I_OnUserKick, I_OnUserPart };
- ServerInstance->Modules->Attach(eventlist, this, 5);
+ Implementation eventlist[] = { I_OnPostJoin, I_OnCleanup, I_OnUserQuit, I_OnUserKick, I_OnUserPart, I_OnOper };
+ ServerInstance->Modules->Attach(eventlist, this, 6);
}
virtual void PushChanMode(Channel* channel, User* user, bool negate = false)
@@ -162,6 +162,17 @@ class ModuleOperPrefixMode : public Module
return 0;
}
+ virtual void OnOper(User *user, const std::string&)
+ {
+ if (user && IS_LOCAL(user) && !user->IsModeSet('H'))
+ {
+ for (UCListIter v = user->chans.begin(); v != user->chans.end(); v++)
+ {
+ PushChanMode(v->first, user);
+ }
+ }
+ }
+
virtual ~ModuleOperPrefixMode()
{
ServerInstance->Modes->DelMode(opm);