From eb70563edb334d008f82b2d8e0c55953eccc55d2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 30 Jul 2018 19:39:19 +0100 Subject: [PATCH] Respond to ISON commands. --- examples/ircd/session.rkt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/ircd/session.rkt b/examples/ircd/session.rkt index f964716..dbd7516 100644 --- a/examples/ircd/session.rkt +++ b/examples/ircd/session.rkt @@ -154,6 +154,15 @@ (irc-privmsg (irc-source-nick (nick) (user)) T Text))))] [_ (void)]))]))) +(spawn #:name 'ison-responder + (stop-when-reloaded) + (define/query-set nicks (ircd-connection-info _ $N _) N) + (on (message (ircd-action $conn (irc-message _ "ISON" $SomeNicks $MoreNicks))) + (define Nicks (append SomeNicks (string-split (or MoreNicks "")))) + (define (on? N) (set-member? (nicks) N)) + (define Present (string-join (filter on? Nicks) " ")) + (send! (ircd-event conn (irc-message server-prefix 303 '("*") Present))))) + (spawn #:name 'session-listener-factory (stop-when-reloaded) (during/spawn (ircd-listener $port)