Just dispatch from the user goroutine. This allows removes a lot of complexity.
git-svn-id: file:///srv/svn/repo/suika/trunk@227 f0ae65fe-ee39-954e-97ec-027ff2717ef4
The logic in this function is about to get more complicated. It'll soon
also dispatch messages in connected downstreams.
git-svn-id: file:///srv/svn/repo/suika/trunk@226 f0ae65fe-ee39-954e-97ec-027ff2717ef4
These are about to get more complicated as we move towards per-entity
ring buffers.
git-svn-id: file:///srv/svn/repo/suika/trunk@222 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Since the logging refactoring in 27e090, entityLog is not used anymore
and can be removed.
git-svn-id: file:///srv/svn/repo/suika/trunk@221 f0ae65fe-ee39-954e-97ec-027ff2717ef4
On some IRC clients, NOTICE messages from a user which does not have a
user or host in its prefix (and therefore only have a Name, and look
like prefixes of servers), are treated as server notices rather than
user notices, and are treated differently. (For that matter, soju also
considers NOTICE messages from users with only a Name in their prefix as
special server messages). On most of these clients, NOTICE messages from
a user are formatted differently and stand out from the large flow of
incoming misceallenous server messages.
This fills the service user with fake User and Host values so that
NOTICE messages from it correctly appear as coming from a user. This
is particularly useful in the context of connection and disconnect
errors NOTICE messages that are broadcast from the service user to all
relevant downstreams.
git-svn-id: file:///srv/svn/repo/suika/trunk@220 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This adds support for sending the exact error message of a network when
it is disconnected, in the reply to the service command `network
status`. This lets users easily examine why a network is currently
disconnected.
No lock is needed because all reads and writes of network.lastError are
made in the user goroutine.
Closes: https://todo.sr.ht/~emersion/soju/28
git-svn-id: file:///srv/svn/repo/suika/trunk@219 f0ae65fe-ee39-954e-97ec-027ff2717ef4
In order to notify the user when we are disconnected from a network
(either due to an error, or due a QUIT), and when we fail reconnecting,
this commit adds support for sending a short NOTICE message from the
service user to all relevant downstreams.
The last error is stored, and cleared on successful connection, to
ensure that the user is *not* flooded with identical connection error
messages, which can often happen when a server is down.
No lock is needed on lastError because it is only read and modified from
the user goroutine.
Closes: https://todo.sr.ht/~emersion/soju/27
git-svn-id: file:///srv/svn/repo/suika/trunk@218 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This centralizes formatting related to message logging in a single
place.
git-svn-id: file:///srv/svn/repo/suika/trunk@215 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Any SendMessage call after Close could potentially block forever if the
outgoing channel was filled up. Now the channel is drained before the
writer goroutine exits.
git-svn-id: file:///srv/svn/repo/suika/trunk@209 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Since network.history is now only accessed from the user goroutine, a
lock becomes unnecessary.
git-svn-id: file:///srv/svn/repo/suika/trunk@204 f0ae65fe-ee39-954e-97ec-027ff2717ef4
And add all the infrastructure required to stop and delete networks.
References: https://todo.sr.ht/~emersion/soju/17
git-svn-id: file:///srv/svn/repo/suika/trunk@202 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This would forward tags even if downstream doesn't support those.
git-svn-id: file:///srv/svn/repo/suika/trunk@192 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This allows both kinds "<username>@<client>/<network>" and
"<username>/<network>@<client>".
git-svn-id: file:///srv/svn/repo/suika/trunk@190 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This matches znc's behavior and is more consistent with the
multiple-upstream mode (where channels and nicks are suffixed with
"/<network>" as well).
git-svn-id: file:///srv/svn/repo/suika/trunk@189 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This function is only safe to call from inside the user goroutine. Let's
make it private.
git-svn-id: file:///srv/svn/repo/suika/trunk@187 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This allows us to perform cleanup actions in the user goroutine. This
removes the need for pendingLISTsLock.
git-svn-id: file:///srv/svn/repo/suika/trunk@179 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Add bouncer logs, in a network/channel/date.log format, in a similar
manner to ZNC log module. PRIVMSG, JOIN, PART, QUIT, MODE are logged.
Add a config directive for the logs file, including a way to disable
them entirely.
git-svn-id: file:///srv/svn/repo/suika/trunk@178 f0ae65fe-ee39-954e-97ec-027ff2717ef4