aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_autoop.cpp
diff options
context:
space:
mode:
authorGravatar Daniel De Graaf2010-02-20 01:25:46 -0600
committerGravatar Daniel De Graaf2010-08-03 17:32:36 -0400
commiteb07c22a42c7850ab155973283f1dde497d03a3e (patch)
tree0bff0ab079909bae0d2624bcc78dc242c2ae7f9e /src/modules/m_autoop.cpp
parentm_modeaccess, channel mode +W, allows the prefix required to set a mode to be... (diff)
Extend +w and +X to take named modes in addition to mode letters
Diffstat (limited to 'src/modules/m_autoop.cpp')
-rw-r--r--src/modules/m_autoop.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp
index 0a7d774c0..34c10caa2 100644
--- a/src/modules/m_autoop.cpp
+++ b/src/modules/m_autoop.cpp
@@ -34,7 +34,9 @@ class AutoOpList : public ListModeBase
return adding ? MOD_RES_DENY : MOD_RES_PASSTHRU;
unsigned int mylevel = channel->GetPrefixValue(source);
std::string mid = parameter.substr(0, pos);
- ModeHandler* mh = ServerInstance->Modes->FindMode(mid);
+ ModeHandler* mh = mid.length() == 1 ?
+ ServerInstance->Modes->FindMode(mid[0], MODETYPE_CHANNEL) :
+ ServerInstance->Modes->FindMode(mid);
if (adding && (!mh || !mh->GetPrefixRank()))
{
@@ -91,7 +93,10 @@ public:
continue;
if (chan->CheckBan(user, (**it).mask.substr(colon+1)))
{
- ModeHandler* given = ServerInstance->Modes->FindMode((**it).mask.substr(0, colon));
+ std::string mid = (**it).mask.substr(0, colon);
+ ModeHandler* given = mid.length() == 1 ?
+ ServerInstance->Modes->FindMode(mid[0], MODETYPE_CHANNEL) :
+ ServerInstance->Modes->FindMode(mid);
if (given)
privs += given->GetModeChar();
}