{
private:
/** The generated lines which are sent to clients. */
- std::vector<std::string> Lines;
+ std::vector<std::string> cachedlines;
public:
/** (Re)build the ISUPPORT vector. */
void Build();
/** Returns the std::vector of ISUPPORT lines. */
- const std::vector<std::string>& GetLines()
- {
- return this->Lines;
- }
+ const std::vector<std::string>& GetLines() const { return cachedlines; }
/** Send the 005 numerics (ISUPPORT) to a user. */
void SendTo(LocalUser* user);
}
// Transform the map into a list of lines, ready to be sent to clients
- std::vector<std::string>& lines = this->Lines;
std::string line;
unsigned int token_count = 0;
- lines.clear();
+ cachedlines.clear();
for (std::map<std::string, std::string>::const_iterator it = tokens.begin(); it != tokens.end(); ++it)
{
// Reached maximum number of tokens for this line or the current token
// is the last one; finalize the line and store it for later use
line.append(":are supported by this server");
- lines.push_back(line);
+ cachedlines.push_back(line);
line.clear();
}
}
void ISupportManager::SendTo(LocalUser* user)
{
- for (std::vector<std::string>::const_iterator i = this->Lines.begin(); i != this->Lines.end(); ++i)
+ for (std::vector<std::string>::const_iterator i = cachedlines.begin(); i != cachedlines.end(); ++i)
user->WriteNumeric(RPL_ISUPPORT, *i);
}