Fix spurious-PART by using on retracted rather than on-stop

This commit is contained in:
Tony Garnock-Jones 2017-08-02 09:52:33 -04:00
parent 203de5807f
commit 38032448bd
2 changed files with 4 additions and 7 deletions

View File

@ -1,3 +0,0 @@
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

@ -65,10 +65,10 @@
(define/query-value next-other-source #f
(ircd-connection-info other-conn $N $U)
(irc-source-nick N U))
(on-stop
(when (current-other-source) (send* #:source (current-other-source) "PART" Ch))
(when (not (hash-has-key? (peer-common-channels) other-conn))
(peer-names (hash-remove (peer-names) other-conn))))
(on (retracted (ircd-channel-member Ch other-conn))
(when (current-other-source) (send* #:source (current-other-source) "PART" Ch)))
(on-stop (when (not (hash-has-key? (peer-common-channels) other-conn))
(peer-names (hash-remove (peer-names) other-conn))))
(begin/dataflow
(when (not (equal? (current-other-source) (next-other-source)))
(if (not (next-other-source)) ;; other-conn is disconnecting