X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_ison.cpp;h=ebb43bdf9c88fe392dba6a4b034b6fb12494a284;hb=3a3ff949670c61a4a8856e1391222e156eb1cd17;hp=8c1c3d2f54459de34a514e6aad6817a2e9ddc60f;hpb=8670d8c51f1debd8afb6732e782fc61d2e479349;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_ison.cpp b/src/coremods/core_ison.cpp index 8c1c3d2f5..ebb43bdf9 100644 --- a/src/coremods/core_ison.cpp +++ b/src/coremods/core_ison.cpp @@ -65,20 +65,21 @@ bool CommandIson::AddNick(User* user, User* toadd, std::string& reply, const std */ CmdResult CommandIson::Handle (const std::vector& parameters, User *user) { - User *u; std::string reply = "303 " + user->nick + " :"; const std::string::size_type pos = reply.size(); - for (unsigned int i = 0; i < parameters.size(); i++) + for (std::vector::const_iterator i = parameters.begin(); i != parameters.end(); ++i) { - u = ServerInstance->FindNickOnly(parameters[i]); + const std::string& targetstr = *i; + + User* const u = ServerInstance->FindNickOnly(targetstr); if (!AddNick(user, u, reply, pos)) { - if ((i == parameters.size() - 1) && (parameters[i].find(' ') != std::string::npos)) + if ((i == parameters.end() - 1) && (targetstr.find(' ') != std::string::npos)) { /* Its a space seperated list of nicks (RFC1459 says to support this) */ - irc::spacesepstream list(parameters[i]); + irc::spacesepstream list(targetstr); std::string item; while (list.GetToken(item))