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:
w00t 2008-07-19 11:11:59 +00:00
parent bffac12387
commit fcd19d4de4

View File

@ -48,8 +48,8 @@ class ModuleServProtectMode : public Module
bm = new ServProtectMode(ServerInstance);
if (!ServerInstance->Modes->AddMode(bm))
throw ModuleException("Could not add new modes!");
Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine, I_OnRawMode };
ServerInstance->Modules->Attach(eventlist, this, 4);
Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine, I_OnRawMode, I_OnUserPreKick };
ServerInstance->Modules->Attach(eventlist, this, 5);
}
@ -114,6 +114,17 @@ class ModuleServProtectMode : public Module
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)
{
return ((src != dst) && (numeric == 319) && dst->IsModeSet('k'));