ServerInstance->Log(DEBUG,"ModeParser::Process start");
+ LastParse = "";
+
/* Special case for displaying the list for listmodes,
* e.g. MODE #chan b, or MODE #chan +b without a parameter
*/
|| (parameter_count > MAXMODES))
{
/* We cant have a mode sequence this long */
- letter = mode_sequence.end();
+ letter = mode_sequence.end() - 1;
continue;
}
}
if (type == MODETYPE_CHANNEL)
{
targetchannel->WriteChannelWithServ(ServerInstance->Config->ServerName, "MODE %s %s%s", targetchannel->name, output_sequence.c_str(), parameter_list.str().c_str());
+ this->LastParse = targetchannel->name;
}
else
{
targetuser->WriteServ("MODE %s %s%s",targetuser->nick,output_sequence.c_str(), parameter_list.str().c_str());
+ this->LastParse = targetuser->nick;
}
}
else
ServerInstance->Log(DEBUG,"Write output sequence and parameters to channel: %s %s%s",targetchannel->name,output_sequence.c_str(),parameter_list.str().c_str());
targetchannel->WriteChannel(user,"MODE %s %s%s",targetchannel->name,output_sequence.c_str(),parameter_list.str().c_str());
FOREACH_MOD(I_OnMode,OnMode(user, targetchannel, TYPE_CHANNEL, output_sequence + parameter_list.str()));
+ this->LastParse = targetchannel->name;
}
else
{
user->WriteTo(targetuser,"MODE %s %s%s",targetuser->nick,output_sequence.c_str(), parameter_list.str().c_str());
FOREACH_MOD(I_OnMode,OnMode(user, targetuser, TYPE_USER, output_sequence));
+ this->LastParse = targetuser->nick;
}
}
+
+ LastParse.append(" ");
+ LastParse.append(output_sequence);
+ LastParse.append(parameter_list.str());
}
}
}
+const std::string& ModeParser::GetLastParse()
+{
+ return LastParse;
+}
+
void ModeParser::CleanMask(std::string &mask)
{
std::string::size_type pos_of_pling = mask.find_first_of('!');
{
ModePair ret;
ret = mh->ModeSet(NULL, user, channel, user->nick);
- if (ret.first)
+ if ((ret.first) && (ret.second == user->nick))
{
pars.append(" ");
pars.append(user->nick);
memset(modehandlers, 0, sizeof(modehandlers));
memset(modewatchers, 0, sizeof(modewatchers));
+ /* Last parse string */
+ LastParse = "";
+
/* Initialise the RFC mode letters */
/* Start with channel simple modes, no params */