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)