#include "inspircd.h"
+#include "modules/whois.h"
+
+enum
+{
+ // From AustHex.
+ RPL_WHOISSERVICE = 310,
+
+ // From UnrealIRCd.
+ ERR_KILLDENY = 485
+};
/** Handles user mode +k
*/
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,
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides usermode +k to protect services from kicks, kills, and mode changes.", VF_VENDOR);
+ return Version("Provides user mode +k to protect services from kicks, kills, and mode changes", VF_VENDOR);
}
void OnWhois(Whois::Context& whois) CXX11_OVERRIDE
{
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);
}
}
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;
}