diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-01 16:04:26 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-01 16:04:26 +0000 |
commit | 7ad9ad1e2b6ccf03dbb5f5148cca1bbf89c2775a (patch) | |
tree | a95ec77e1b25cd025accabdcefc0ba020f48b72b | |
parent | 569114e4c2f8ef8b14d48d4a94d7226e7f87eaff (diff) |
Move new listmode check deeper into the mode parser so that it doesnt generate spurious craq (thanks HiroP_)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6853 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/mode.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 0229eddb1..7a31038a6 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -291,6 +291,8 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool while (mode && *mode) { + unsigned char mletter = *mode; + if (*mode == '+') { mode++; @@ -300,9 +302,9 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool /* Ensure the user doesnt request the same mode twice, * so they cant flood themselves off out of idiocy. */ - if (!sent[*mode]) + if (!sent[mletter]) { - sent[*mode] = true; + sent[mletter] = true; } else { @@ -310,17 +312,17 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool continue; } - if (ServerInstance->Config->HideModeLists[*mode] && (targetchannel->GetStatus(user) < STATUS_HOP)) - { - user->WriteServ("482 %s %s :Only half-operators and above may view the +%c list",user->nick, targetchannel->name, *mode++); - continue; - } - ModeHandler *mh = this->FindMode(*mode, MODETYPE_CHANNEL); bool display = true; if ((mh) && (mh->IsListMode())) { + if (ServerInstance->Config->HideModeLists[mletter] && (targetchannel->GetStatus(user) < STATUS_HOP)) + { + user->WriteServ("482 %s %s :Only half-operators and above may view the +%c list",user->nick, targetchannel->name, *mode++); + continue; + } + /** See below for a description of what craq this is :D */ unsigned char handler_id = (*mode - 65) | mask; |