From: 0x277F <0x277F@gmail.com> Date: Fri, 22 Jul 2016 10:12:05 +0000 (-0600) Subject: stripcolor now strips from part messages (#1175) X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=c8602a49931e31593efefa45f141a06ce8e9a90f;p=user%2Fhenk%2Fcode%2Finspircd.git stripcolor now strips from part messages (#1175) --- diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp index 0d4bdb877..592aeda90 100644 --- a/src/modules/m_stripcolor.cpp +++ b/src/modules/m_stripcolor.cpp @@ -83,6 +83,23 @@ class ModuleStripColor : public Module return MOD_RES_PASSTHRU; } + void OnUserPart(Membership* memb, std::string& partmessage, CUList& except_list) CXX11_OVERRIDE + { + User* user = memb->user; + Channel* channel = memb->chan; + + if (!IS_LOCAL(user)) + return; + + bool active = channel->GetExtBanStatus(user, 'S').check(!user->IsModeSet(csc)) + && ServerInstance->OnCheckExemption(user, channel, "stripcolor") != MOD_RES_ALLOW; + + if (active) + { + InspIRCd::StripColor(partmessage); + } + } + Version GetVersion() CXX11_OVERRIDE { return Version("Provides channel +S mode (strip ansi color)", VF_VENDOR);