for (UCListIter i = dest->chans.begin(); i != dest->chans.end(); i++)
{
- Channel* c = *i;
+ Channel* c = (*i)->chan;
/* If the target is the sender, neither +p nor +s is set, or
* the channel contains the user, it is not a spy channel
*/
{
std::string line;
std::ostringstream prefix;
- std::string::size_type start, pos, length;
+ std::string::size_type start, pos;
prefix << dest->nick << " :";
line = prefix.str();
for (start = 0; (pos = cl.find(' ', start)) != std::string::npos; start = pos+1)
{
- length = (pos == std::string::npos) ? cl.length() : pos;
-
- if (line.length() + namelen + length - start > 510)
+ if (line.length() + namelen + pos - start > 510)
{
ServerInstance->SendWhoisLine(source, dest, 319, line);
line = prefix.str();
}
- if(pos == std::string::npos)
- {
- line.append(cl.substr(start, length - start));
- break;
- }
- else
- {
- line.append(cl.substr(start, length - start + 1));
- }
+ line.append(cl.substr(start, pos - start + 1));
}
if (line.length() != prefix.str().length())
}
else
{
- std::string serverdesc = ServerInstance->GetServerDescription(dest->server->GetName());
- ServerInstance->SendWhoisLine(user, dest, 312, "%s %s :%s", dest->nick.c_str(), dest->server->GetName().c_str(), serverdesc.c_str());
+ ServerInstance->SendWhoisLine(user, dest, 312, "%s %s :%s", dest->nick.c_str(), dest->server->GetName().c_str(), dest->server->GetDesc().c_str());
}
if (dest->IsAway())