Fix for bug #646, reported by whotookspaz (+y not being applied to existing channels on oper). Thanks!

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10907 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
w00t 2008-12-24 00:45:02 +00:00
parent 1c07cf9aaa
commit f8254d68b5

View File

@ -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);