For messages that contain either a colon **or** a space character, a
messagePrefix needs to be added to the serialized messages. Previously,
a message prefix was only added for messages containing a space
character. This causes messages which only contain a colon, but not a
space to be serialized incorrectly.
For example, prior to this commit a command like `PRIVMSG #foo ::)`,
which should send the message `:)` to the channel `#foo`, was
serialized as `PRIVMSG #foo :)` which only causes a `)` character to be
sent to the channel `#foo`.
This allows distinguishing the two commands in the output of the
Pretty() function. This is useful for IRC client which use the output of
the Pretty() function for formating IRC messages.
escaping of colons
commit a2ddeff515d14fd010bd3d705ea6af3d3c791869
Merge: 634e679 6a0f21c
Author: Liam Stanley <me@liamstanley.io>
Date: Sat Jul 27 00:51:17 2019 -0400
fix merge conflicts
commit 6a0f21c9750705ed9aff2bd398640dc1f8b3e6b0
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date: Sun Jul 21 21:18:23 2019 +0200
use JoinHostPort() in client.Server()
This fixes a bug where girc would fail to connect if the server was
specified as an IPv6 address since appending a colon is not enough in
that case.
This commit adds support for the IRCv3.2 MONITOR command [1]. This
includes a new function for sending MONITOR commands to the IRC server
and constants for creating handlers for the server responses.
Discussion: Currently no fancy abstraction is offered for the MONITOR
command. Meaning the caller can:
1. Send MONITOR commands to the server with invalid modifier, where
`modifier ∉ {+, -, C, L, S}`.
2. Add a target to the list of targets being monitored which is already
in that list. Which the client MUST NOT do according to the
specification.
Both 1. and 2. could be addressed by implementing separate functions for
the different MONITOR command modifiers (e.g. `MonitorAdd()`,
`MonitorDel()`, …). If 2. is not considered an issue and should be
resolved by the caller 1. could alternatively by defining a new type for
the modifier.
An entirely different solution would be adding methods for monitoring to
the `User struct`. For example: `User.Monitor(), User.Unmonitor(), …`.
[1]: https://ircv3.net/specs/core/monitor-3.2.html