X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_anticaps.cpp;h=92a9b9ff958a829d7d4a2cabe2f77f3798dea3d0;hb=c7b938502295ddc5b2c89e0854d8c5c19ede32dc;hp=463ff809b6bafeeba1df568c1b0cc497af58bc7e;hpb=87b1461e2a4710a38b32186c2582da9fe9bb3804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_anticaps.cpp b/src/modules/m_anticaps.cpp index 463ff809b..92a9b9ff9 100644 --- a/src/modules/m_anticaps.cpp +++ b/src/modules/m_anticaps.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017 Peter Powell + * Copyright (C) 2019 Robby + * Copyright (C) 2018-2021 Sadie Powell * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -101,6 +102,7 @@ class AntiCapsMode : public ParamMode >(Creator, "anticaps", 'B') { + syntax = "{ban|block|mute|kick|kickban}::"; } ModeAction OnSet(User* source, Channel* channel, std::string& parameter) CXX11_OVERRIDE @@ -113,7 +115,7 @@ class AntiCapsMode : public ParamModeWriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, "Invalid anticaps mode parameter. Syntax: :{minlen}:{percent}.")); + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; } @@ -156,8 +158,8 @@ class ModuleAntiCaps : public Module { private: CheckExemption::EventProvider exemptionprov; - std::bitset uppercase; - std::bitset lowercase; + std::bitset uppercase; + std::bitset lowercase; AntiCapsMode mode; void CreateBan(Channel* channel, User* user, bool mute) @@ -173,7 +175,7 @@ class ModuleAntiCaps : public Module void InformUser(Channel* channel, User* user, const std::string& message) { - user->WriteNumeric(ERR_CANNOTSENDTOCHAN, channel, message + " and was blocked."); + user->WriteNumeric(Numerics::CannotSendTo(channel, message + " and was blocked.")); } public: @@ -188,7 +190,7 @@ class ModuleAntiCaps : public Module ConfigTag* tag = ServerInstance->Config->ConfValue("anticaps"); uppercase.reset(); - const std::string upper = tag->getString("uppercase", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + const std::string upper = tag->getString("uppercase", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1); for (std::string::const_iterator iter = upper.begin(); iter != upper.end(); ++iter) uppercase.set(static_cast(*iter)); @@ -297,7 +299,7 @@ class ModuleAntiCaps : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides support for punishing users that send capitalised messages", VF_COMMON|VF_VENDOR); + return Version("Adds channel mode B (anticaps) which allows channels to block messages which are excessively capitalised.", VF_COMMON|VF_VENDOR); } };