* +------------------------------------+
*
* 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.
char ModeHandler::GetNeededPrefix()
{
+ if (prefixneeded == '%' && !ServerInstance->Config->AllowHalfop)
+ return '@';
return prefixneeded;
}
/* 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,
/* Was there at least one valid mode in the sequence? */
if (!output_sequence.empty())
{
+ LastParseParams.push_front(output_sequence);
if (servermode)
{
if (type == MODETYPE_CHANNEL)
}
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());
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);
}
}
}