X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmode.cpp;h=78993caad8799a76d1d70e968a4e83a7908701ca;hb=c71801ebc4577b19e604c0d91a95fdcfe5250cc9;hp=a60184ef2593fa8f91435a35aab7d4310f23520c;hpb=a5baaeecf6aac2be7bfdf44d8be23f167da03db5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/mode.cpp b/src/mode.cpp index a60184ef2..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, @@ -763,7 +762,8 @@ void ModeParser::Process(const std::vector& parameters, User *user, /* Was there at least one valid mode in the sequence? */ if (!output_sequence.empty()) { - if (servermode) + LastParseParams.push_front(output_sequence); + if (!user) { if (type == MODETYPE_CHANNEL) { @@ -778,7 +778,6 @@ void ModeParser::Process(const std::vector& parameters, User *user, } else { - LastParseParams.push_front(output_sequence); if (type == MODETYPE_CHANNEL) { targetchannel->WriteChannel(user, "MODE %s %s%s", targetchannel->name.c_str(), output_sequence.c_str(), parameter_list.str().c_str()); @@ -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); } } }