From c564bd28ec39afa120ad90c9f34bdb5a712c742b Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 30 Jul 2018 19:39:11 +0100 Subject: [PATCH 1/2] Weirdly, irssi sends the "ison" command in lower-case. --- examples/ircd/message.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ircd/message.rkt b/examples/ircd/message.rkt index 50d1b46..9087d3b 100644 --- a/examples/ircd/message.rkt +++ b/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)) From eb70563edb334d008f82b2d8e0c55953eccc55d2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 30 Jul 2018 19:39:19 +0100 Subject: [PATCH 2/2] 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)