diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-14 19:04:44 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-14 19:04:44 +0000 |
commit | a4fed1c1c767c8e31ffa47dc68ee7537ca28e317 (patch) | |
tree | 4c327ba114e8c5cef9cd099595677ab2949cdea7 /src | |
parent | 38d22d80a4235118cb85307693b1e9d58bed23cf (diff) |
Duh, wasnt working when the user had NO prefixes at all!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8939 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/mode.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 085a54326..a89e3ae19 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -516,14 +516,15 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser if (IS_LOCAL(user) && (MOD_RESULT == ACR_DENY)) continue; - if (IS_LOCAL(user) && (MOD_RESULT != ACR_ALLOW)) { + ServerInstance->Log(DEBUG,"Enter minimum prefix check"); /* Check access to this mode character */ if ((type == MODETYPE_CHANNEL) && (modehandlers[handler_id]->GetNeededPrefix())) { char needed = modehandlers[handler_id]->GetNeededPrefix(); ModeHandler* prefixmode = FindPrefix(needed); + ServerInstance->Log(DEBUG,"Needed prefix: %c", needed); if (prefixmode) { unsigned int neededrank = prefixmode->GetPrefixRank(); @@ -533,16 +534,14 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser * first, so we don't need to iterate, we just look up the first instead. */ std::string modestring = targetchannel->GetAllPrefixChars(user); - if (!modestring.empty()) + char ml = (modestring.empty() ? '\0' : modestring[0]); + ModeHandler* ourmode = FindPrefix(ml); + if (!ourmode || ourmode->GetPrefixRank() < neededrank) { - ModeHandler* ourmode = FindPrefix(modestring[0]); - if (!ourmode || ourmode->GetPrefixRank() < neededrank) - { - /* Bog off */ - user->WriteServ("482 %s %s :You require channel privilege '%c' or above to execute channel mode '%c'", - user->nick, targetchannel->name, needed, modechar); - continue; - } + /* Bog off */ + user->WriteServ("482 %s %s :You require channel privilege '%c' or above to execute channel mode '%c'", + user->nick, targetchannel->name, needed, modechar); + continue; } } } |