X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operchans.cpp;h=9e30ceca2a95dc6a9b72a38ff7dc696728bedb5f;hb=dcafba95960685120b1f6d902de623ca10ed6135;hp=6863fc2441bf6858f4e65a140ef8ad8d674189e7;hpb=473df5542f96cf572a918979db843a75a2c94798;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 6863fc244..9e30ceca2 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -1,10 +1,13 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2013, 2018-2020 Sadie Powell + * Copyright (C) 2012-2013 Attila Molnar + * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2007 Robin Burchell - * Copyright (C) 2004, 2006 Craig Edwards + * Copyright (C) 2004, 2006, 2010 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 @@ -63,15 +66,10 @@ class ModuleOperChans : public Module if (!user->IsOper()) return MOD_RES_PASSTHRU; - // Check whether the oper's type matches the ban. - const std::string submask = mask.substr(2); - if (InspIRCd::Match(user->oper->name, submask)) - return MOD_RES_DENY; - - // If the oper's type contains spaces recheck with underscores. + // Replace spaces with underscores as they're prohibited in mode parameters. std::string opername(user->oper->name); stdalgo::string::replace_all(opername, space, underscore); - if (InspIRCd::Match(opername, submask)) + if (InspIRCd::Match(opername, mask.substr(2))) return MOD_RES_DENY; return MOD_RES_PASSTHRU; @@ -84,7 +82,7 @@ class ModuleOperChans : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides support for oper-only channels via channel mode +O and extban 'O'", VF_VENDOR); + return Version("Adds channel mode O (operonly) which prevents non-server operators from joining the channel.", VF_VENDOR); } };