mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Convert helpop to use a ModeHandler base rather than a SimpleUserModeHandler, users should not be able to set +h. Fixes #750, reported by Taros.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11175 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
d17bf9f895
commit
63f8e06d41
@ -19,10 +19,32 @@ static std::map<irc::string, std::string> helpop_map;
|
||||
|
||||
/** Handles user mode +h
|
||||
*/
|
||||
class Helpop : public SimpleUserModeHandler
|
||||
class Helpop : public ModeHandler
|
||||
{
|
||||
public:
|
||||
Helpop(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'h') { }
|
||||
Helpop(InspIRCd* Instance) : ModeHandler(Instance, 'h', 0, 0, false, MODETYPE_USER, true) { }
|
||||
|
||||
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
|
||||
{
|
||||
if (adding)
|
||||
{
|
||||
if (!dest->IsModeSet('h'))
|
||||
{
|
||||
dest->SetMode('h',true);
|
||||
return MODEACTION_ALLOW;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dest->IsModeSet('h'))
|
||||
{
|
||||
dest->SetMode('h',false);
|
||||
return MODEACTION_ALLOW;
|
||||
}
|
||||
}
|
||||
|
||||
return MODEACTION_DENY;
|
||||
}
|
||||
};
|
||||
|
||||
/** Handles /HELPOP
|
||||
|
Loading…
x
Reference in New Issue
Block a user