mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-11 11:39:02 -04:00
Hook OnUserPreKick and disallow kick on +k users also
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10039 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
bffac12387
commit
fcd19d4de4
@ -48,8 +48,8 @@ class ModuleServProtectMode : public Module
|
|||||||
bm = new ServProtectMode(ServerInstance);
|
bm = new ServProtectMode(ServerInstance);
|
||||||
if (!ServerInstance->Modes->AddMode(bm))
|
if (!ServerInstance->Modes->AddMode(bm))
|
||||||
throw ModuleException("Could not add new modes!");
|
throw ModuleException("Could not add new modes!");
|
||||||
Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine, I_OnRawMode };
|
Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine, I_OnRawMode, I_OnUserPreKick };
|
||||||
ServerInstance->Modules->Attach(eventlist, this, 4);
|
ServerInstance->Modules->Attach(eventlist, this, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -114,6 +114,17 @@ class ModuleServProtectMode : public Module
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual int OnUserPreKick(User *src, User *dst, Channel *c, const std::string &reason)
|
||||||
|
{
|
||||||
|
if (dst->IsModeSet('k'))
|
||||||
|
{
|
||||||
|
src->WriteNumeric(484, "%s %s :You are not permitted to kick services", src->nick.c_str(), c->name.c_str());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
virtual int OnWhoisLine(User* src, User* dst, int &numeric, std::string &text)
|
virtual int OnWhoisLine(User* src, User* dst, int &numeric, std::string &text)
|
||||||
{
|
{
|
||||||
return ((src != dst) && (numeric == 319) && dst->IsModeSet('k'));
|
return ((src != dst) && (numeric == 319) && dst->IsModeSet('k'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user