summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-19 11:11:59 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-19 11:11:59 +0000
commitfcd19d4de4b438f1762a2bbd2c90e6cc77ac46a2 (patch)
tree9da3706a7777cc26ed78b6a3c9e57648ba867051
parentbffac12387db878bb6413fc1d1a1f3b38dfdc1d6 (diff)
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
-rw-r--r--src/modules/m_servprotect.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp
index 3aafda237..e9012ac31 100644
--- a/src/modules/m_servprotect.cpp
+++ b/src/modules/m_servprotect.cpp
@@ -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'));