Support QUIT notifications. Kind of.

This commit is contained in:
Tony Garnock-Jones 2017-08-01 11:56:45 -04:00
parent 6b2ee53fa8
commit eeb655a0ac
2 changed files with 17 additions and 19 deletions

View File

@ -4,5 +4,9 @@ If two connections, A and B, exist, and
- A renames itself to A'
then B receives two ":A NICK A'" messages. This shouldn't happen.
When X quits (disconnects), peers in channels X was in get a PART.
They should get a QUIT.
A similar problem occurs for ":B QUIT" messages when A is in two
channels that B is also in, and B disconnects.
When A is a member of #room1, which has B and C in it, and A
disconnects, the session code futilely sends ":B PART #room1" and ":C
PART #room1", even though the connection is now gone.

View File

@ -51,23 +51,17 @@
(irc-source-nick N U))
(on-stop (when (current-other-source) (send* #:source (current-other-source) "PART" Ch)))
(begin/dataflow
(when (and (next-other-source)
;; ^ Becomes #f when other-conn disconnects,
;; apparently by retraction of ircd-connection-info
;; but before the retraction of ircd-channel-member
;; is processed for some reason. TODO investigate
;; this more closely. Should event-handlers that
;; stop a facet prevent execution of contained
;; event-handlers in the same turn?
(not (equal? (current-other-source) (next-other-source))))
(if (initial-names-sent?)
(if (current-other-source)
(when (not (equal? this-conn other-conn)) ;; avoid dups for our own connection
(send* #:source (current-other-source) "NICK"
(irc-source-nick-nick (next-other-source))))
(send* #:source (next-other-source) "JOIN" Ch))
(initial-member-nicks (set-add (initial-member-nicks)
(irc-source-nick-nick (next-other-source)))))
(when (not (equal? (current-other-source) (next-other-source)))
(if (next-other-source) ;; not disconnecting, IOW
(if (initial-names-sent?)
(if (current-other-source)
(when (not (equal? this-conn other-conn)) ;; avoid dups for our own connection
(send* #:source (current-other-source) "NICK"
(irc-source-nick-nick (next-other-source))))
(send* #:source (next-other-source) "JOIN" Ch))
(initial-member-nicks (set-add (initial-member-nicks)
(irc-source-nick-nick (next-other-source)))))
(send* #:source (current-other-source) "QUIT"))
(current-other-source (next-other-source)))))
(on (asserted (ircd-channel-topic Ch $topic))
(if topic