if (!ThisModes.empty())
{
std::string buf;
- std::stringstream ss(ThisModes);
+ irc::spacesepstream ss(ThisModes);
std::vector<std::string> modes;
modes.push_back(user->nick);
// split ThisUserModes into modes and mode params
- while (ss >> buf)
+ while (ss.GetToken(buf))
modes.push_back(buf);
ServerInstance->Parser.CallHandler("MODE", modes, user);
smodes = "+" + smodes;
std::string buf;
- std::stringstream ss(smodes);
+ irc::spacesepstream ss(smodes);
std::vector<std::string> modes;
modes.push_back(u->nick);
// split into modes and mode params
- while (ss >> buf)
+ while (ss.GetToken(buf))
modes.push_back(buf);
ServerInstance->Parser.CallHandler("MODE", modes, u);
ShunEnabledCommands.clear();
- std::stringstream dcmds(cmds);
+ irc::spacesepstream dcmds(cmds);
std::string thiscmd;
- while (dcmds >> thiscmd)
+ while (dcmds.GetToken(thiscmd))
{
ShunEnabledCommands.insert(thiscmd);
}
bool InspIRCd::MatchMask(const std::string& masks, const std::string& hostname, const std::string& ipaddr)
{
- std::stringstream masklist(masks);
+ irc::spacesepstream masklist(masks);
std::string mask;
- while (masklist >> mask)
+ while (masklist.GetToken(mask))
{
if (InspIRCd::Match(hostname, mask, ascii_case_insensitive_map) ||
InspIRCd::MatchCIDR(ipaddr, mask, ascii_case_insensitive_map))