/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2013, 2017 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2012, 2014-2015 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012 William Pitcock <nenolod@dereferenced.org>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
#include "inspircd.h"
+enum
+{
+ // From Charybdis.
+ ERR_MLOCKRESTRICTED = 742
+};
+
class ModuleMLock : public Module
{
StringExtItem mlock;
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Implements the ability to have server-side MLOCK enforcement.", VF_VENDOR);
+ return Version("Implements the ability to have server-side MLOCK enforcement", VF_VENDOR);
}
- ModResult OnRawMode(User* source, Channel* channel, ModeHandler* mh, const std::string& parameter, bool adding)
+ ModResult OnRawMode(User* source, Channel* channel, ModeHandler* mh, const std::string& parameter, bool adding) CXX11_OVERRIDE
{
if (!channel)
return MOD_RES_PASSTHRU;
std::string::size_type p = mlock_str->find(mode);
if (p != std::string::npos)
{
- source->WriteNumeric(742, "%s %c %s :MODE cannot be set due to channel having an active MLOCK restriction policy",
- channel->name.c_str(), mode, mlock_str->c_str());
+ source->WriteNumeric(ERR_MLOCKRESTRICTED, channel->name, mode, *mlock_str, "MODE cannot be set due to the channel having an active MLOCK restriction policy");
return MOD_RES_DENY;
}