From 8de523d8ee59a7fef175e54c1853c7cb88bb469d Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 30 Jul 2017 19:28:21 -0400 Subject: [PATCH] Move lookup-nick into protocol.rkt --- examples/ircd/channel.rkt | 3 --- examples/ircd/protocol.rkt | 9 ++++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/ircd/channel.rkt b/examples/ircd/channel.rkt index 312fdc0..2ccf393 100644 --- a/examples/ircd/channel.rkt +++ b/examples/ircd/channel.rkt @@ -5,9 +5,6 @@ (require/activate syndicate/reload) -(define (lookup-nick conn) - (immediate-query [query-value #f (ircd-connection-info conn $N _) N])) - (spawn #:name 'channel-factory (stop-when-reloaded) (during/spawn (ircd-channel-member $Ch _) diff --git a/examples/ircd/protocol.rkt b/examples/ircd/protocol.rkt index b28a38e..3cd51c4 100644 --- a/examples/ircd/protocol.rkt +++ b/examples/ircd/protocol.rkt @@ -8,7 +8,9 @@ (struct-out ircd-channel-topic) (struct-out ircd-action) - (struct-out ircd-event)) + (struct-out ircd-event) + + lookup-nick) ;; A Connection is a TcpAddress @@ -21,3 +23,8 @@ (struct ircd-action (conn message) #:prefab) ;; message (struct ircd-event (conn message) #:prefab) ;; message + +;;--------------------------------------------------------------------------- + +(define (lookup-nick conn) + (immediate-query [query-value #f (ircd-connection-info conn $N _) N]))