* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
* Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
* Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
- * Copyright (C) 2006, 2010 Craig Edwards <brain@inspircd.org>
+ * Copyright (C) 2004, 2006, 2010 Craig Edwards <brain@inspircd.org>
*
* 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
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;
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);
}
};