From ed0307d4e537afc44e5378cd1eec7b26adc246a7 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 28 Jan 2019 13:54:18 +0000 Subject: [PATCH] Parity with the other version --- syndicate/examples/ircd/message.rkt | 2 +- syndicate/examples/ircd/session.rkt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/syndicate/examples/ircd/message.rkt b/syndicate/examples/ircd/message.rkt index 50d1b46..9087d3b 100644 --- a/syndicate/examples/ircd/message.rkt +++ b/syndicate/examples/ircd/message.rkt @@ -64,7 +64,7 @@ (define (parse-command prefix line) (match-define (pregexp #px"^([^ ]+)( +([^:]+)?(:(.*))?)?$" (list _ command _ params _ rest)) line) (irc-message prefix - command + (string-upcase command) (string-split (or params "")) rest)) diff --git a/syndicate/examples/ircd/session.rkt b/syndicate/examples/ircd/session.rkt index 552411f..0920158 100644 --- a/syndicate/examples/ircd/session.rkt +++ b/syndicate/examples/ircd/session.rkt @@ -151,6 +151,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)