diff --git a/examples/ircd/TODO.md b/examples/ircd/TODO.md deleted file mode 100644 index 13186c6..0000000 --- a/examples/ircd/TODO.md +++ /dev/null @@ -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. diff --git a/examples/ircd/session.rkt b/examples/ircd/session.rkt index a549823..17b5c1d 100644 --- a/examples/ircd/session.rkt +++ b/examples/ircd/session.rkt @@ -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