Exemple #1
0
void CommandFJoin::RemoveStatus(Channel* c)
{
	Modes::ChangeList changelist;

	const ModeParser::ModeHandlerMap& mhs = ServerInstance->Modes.GetModes(MODETYPE_CHANNEL);
	for (ModeParser::ModeHandlerMap::const_iterator i = mhs.begin(); i != mhs.end(); ++i)
	{
		ModeHandler* mh = i->second;

		// Add the removal of this mode to the changelist. This handles all kinds of modes, including prefix modes.
		mh->RemoveMode(c, changelist);
	}

	ServerInstance->Modes.Process(ServerInstance->FakeClient, c, NULL, changelist, ModeParser::MODE_LOCALONLY);
}
Exemple #2
0
void CommandFJoin::RemoveStatus(Channel* c)
{
	irc::modestacker stack(false);

	for (char modeletter = 'A'; modeletter <= 'z'; ++modeletter)
	{
		ModeHandler* mh = ServerInstance->Modes->FindMode(modeletter, MODETYPE_CHANNEL);

		/* Passing a pointer to a modestacker here causes the mode to be put onto the mode stack,
		 * rather than applied immediately. Module unloads require this to be done immediately,
		 * for this function we require tidyness instead. Fixes bug #493
		 */
		if (mh)
			mh->RemoveMode(c, &stack);
	}

	ApplyModeStack(ServerInstance->FakeClient, c, stack);
}