X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_servprotect.cpp;h=a5d7a82e43bc9850d737fa94b0f37046d85a744e;hb=de4e4860091fe5a9a530acdb25f9a17e22323acf;hp=97670237b4fee551079f29398bf8e42e147ecca4;hpb=e0931343939bc15ea9aaa884eab61d80827074c6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 97670237b..a5d7a82e4 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -20,6 +20,16 @@ #include "inspircd.h" +#include "modules/whois.h" + +enum +{ + // From AustHex. + RPL_WHOISSERVICE = 310, + + // From UnrealIRCd. + ERR_KILLDENY = 485 +}; /** Handles user mode +k */ @@ -28,7 +38,7 @@ class ServProtectMode : public ModeHandler public: ServProtectMode(Module* Creator) : ModeHandler(Creator, "servprotect", 'k', PARAM_NONE, MODETYPE_USER) { oper = true; } - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE { /* Because this returns MODEACTION_DENY all the time, there is only ONE * way to add this mode and that is at client introduction in the UID command, @@ -62,7 +72,7 @@ class ModuleServProtectMode : public Module, public Whois::EventListener, public { if (whois.GetTarget()->IsModeSet(bm)) { - whois.SendLine(310, "is a Network Service on " + ServerInstance->Config->Network); + whois.SendLine(RPL_WHOISSERVICE, "is a Network Service on " + ServerInstance->Config->Network); } } @@ -106,7 +116,7 @@ class ModuleServProtectMode : public Module, public Whois::EventListener, public if (dst->IsModeSet(bm)) { - src->WriteNumeric(485, InspIRCd::Format("You are not permitted to kill %s services!", ServerInstance->Config->Network.c_str())); + src->WriteNumeric(ERR_KILLDENY, InspIRCd::Format("You are not permitted to kill %s services!", ServerInstance->Config->Network.c_str())); ServerInstance->SNO->WriteGlobalSno('a', src->nick+" tried to kill service "+dst->nick+" ("+reason+")"); return MOD_RES_DENY; }