X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_blockcaps.cpp;h=0acdc4d6c0dc7ea8a4f86846d37b9cf688454481;hb=f3f2388a81b6463e1229fa5bf2b8c427440bf406;hp=fa780427cbaa051c5f7fd5cf31ee551a09857c9a;hpb=77730fd5f09f8fc193205654c8bba84d34365670;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index fa780427c..0acdc4d6c 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -1,10 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2006, 2008 Craig Edwards - * Copyright (C) 2006-2007 Dennis Friis - * Copyright (C) 2007 Robin Burchell - * Copyright (C) 2006 Oliver Lupton + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell + * Copyright (C) 2012-2014 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2008 Thomas Stagner + * Copyright (C) 2008 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006, 2008-2009 Craig Edwards * * 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 @@ -93,7 +97,8 @@ public: // any upper case letters. if (length > 0 && round((upper * 100) / length) >= percent) { - user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, InspIRCd::Format("Your message cannot contain %d%% or more capital letters if it's longer than %d characters", percent, minlen)); + const std::string msg = InspIRCd::Format("Your message cannot contain %d%% or more capital letters if it's longer than %d characters", percent, minlen); + user->WriteNumeric(Numerics::CannotSendTo(c, msg)); return MOD_RES_DENY; } } @@ -113,14 +118,14 @@ public: lowercase.set(static_cast(*iter)); uppercase.reset(); - const std::string upper = tag->getString("uppercase", tag->getString("capsmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")); + const std::string upper = tag->getString("uppercase", tag->getString("capsmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1)); for (std::string::const_iterator iter = upper.begin(); iter != upper.end(); ++iter) uppercase.set(static_cast(*iter)); } Version GetVersion() CXX11_OVERRIDE { - return Version("Provides support to block all-CAPS channel messages and notices", VF_VENDOR); + return Version("Adds channel mode B (blockcaps) which allows channels to block messages which are excessively capitalised.", VF_VENDOR); } };