X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmode.cpp;h=78993caad8799a76d1d70e968a4e83a7908701ca;hb=090e7b616104723960ab51d8faa966af333eb15d;hp=d9c5c9d2b0668620ded66ad707022c43c698769c;hpb=3ddb8accad3b5af20242da489c2143cb9b34a940;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/mode.cpp b/src/mode.cpp index d9c5c9d2b..78993caad 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -12,9 +12,6 @@ */ /* $Core */ -/* $ExtraDeps: $(RELCPPFILES) */ -/* $ExtraObjects: modes/modeclasses.a */ -/* $ExtraBuild: @${MAKE} -C "modes" DIRNAME="src/modes" CC="$(CC)" $(MAKEARGS) CPPFILES="$(CPPFILES)" */ #include "inspircd.h" #include "inspstring.h" @@ -68,6 +65,8 @@ bool ModeHandler::IsListMode() char ModeHandler::GetNeededPrefix() { + if (prefixneeded == '%' && !ServerInstance->Config->AllowHalfop) + return '@'; return prefixneeded; } @@ -612,10 +611,10 @@ void ModeParser::Process(const std::vector& parameters, User *user, /* If the mode defined by the handler is not '\0', but the handler for it * cannot be found, they probably dont have the right module loaded to implement * the prefix they want to compare the mode against, e.g. '&' for m_chanprotect. - * Revert to checking against the minimum core prefix, '%'. + * Revert to checking against the minimum core prefix, '%' or '@'. */ if (needed && !prefixmode) - prefixmode = FindPrefix('%'); + prefixmode = ServerInstance->Config->AllowHalfop ? FindPrefix('%') : FindPrefix('@'); unsigned int neededrank = prefixmode->GetPrefixRank(); /* Compare our rank on the channel against the rank of the required prefix, @@ -764,7 +763,7 @@ void ModeParser::Process(const std::vector& parameters, User *user, if (!output_sequence.empty()) { LastParseParams.push_front(output_sequence); - if (servermode) + if (!user) { if (type == MODETYPE_CHANNEL) { @@ -1162,7 +1161,7 @@ void ModeHandler::RemoveMode(User* user, irc::modestacker* stack) sprintf(moderemove,"-%c",this->GetModeChar()); parameters.push_back(user->nick); parameters.push_back(moderemove); - ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient, false); + ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient, true); } } }