A malicious IRCd could send a WHO reply for a nick which consisted completely
out of prefix characters (thus an empty nick). In this case
std::string::find_first_of() would return std::string::npos. This argument would
make std::string::substr() throw an exception and kill the process.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fixes a bug where sending anything to a client, such as with
PutModule will fail because it will refer to the new nick before the
client knows about it. The watch module did this.
Buflines need to know which part of text to wrap with the timestamp. The
second parameter to `AddLine` (and shorthands) is that text, which after
wrapping is added as the `text` parameter to `NamedFormat`.
Timestamps are formatted at the moment buffers are flushed to the
client. The client parameter to `GetLine` provides access to the User
and the new server-time capability.
If a client sends STARTTLS to the IRC server, once the IRC server responds
with a 670 then it will expect all future communications to happen over
TLS.
The result of CIRCNetwork::IsUserOnline() will only show clients which
do not have the away state set. This value is not set from the IRC
command AWAY, but a future module could use this behaviour.
Some CIRCNetwork::IsUserAttached() checks are now moved into of
CIRCNetwork::IsUserOnline() checks.
This allows "away" clients to store buffer even if KeepBuffer is false.