From 7ad9ad1e2b6ccf03dbb5f5148cca1bbf89c2775a Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 1 May 2007 16:04:26 +0000 Subject: 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 --- src/mode.cpp | 18 ++++++++++-------- 1 file 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; -- cgit v1.2.3