summaryrefslogtreecommitdiff
path: root/src/modules/m_servprotect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_servprotect.cpp')
-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'));