2021-06-04 13:56:03 +00:00
|
|
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
;;; SPDX-FileCopyrightText: Copyright © 2010-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
2021-06-01 15:19:24 +00:00
|
|
|
|
2020-04-27 18:27:48 +00:00
|
|
|
#lang syndicate
|
2019-01-30 16:40:52 +00:00
|
|
|
|
|
|
|
(require "protocol.rkt")
|
|
|
|
(require "message.rkt")
|
|
|
|
|
2020-04-27 18:27:48 +00:00
|
|
|
(require/activate syndicate/reload)
|
2019-01-30 16:40:52 +00:00
|
|
|
|
|
|
|
(spawn #:name 'greeter
|
|
|
|
(stop-when-reloaded)
|
|
|
|
(on (asserted (ircd-channel-member $Ch $conn))
|
|
|
|
(match-define (ircd-connection-info _ N U)
|
|
|
|
(immediate-query [query-value #f ($ I (ircd-connection-info conn _ _)) I]))
|
|
|
|
;; TODO: history replay? As the following illustrates, we are able to forge messages
|
|
|
|
(send! (ircd-event conn (irc-message (irc-source-nick N U) "PRIVMSG" (list Ch)
|
|
|
|
(format "Welcome to ~a, ~a!" Ch N))))))
|
2019-02-05 13:30:18 +00:00
|
|
|
|
|
|
|
(spawn #:name 'authenticator
|
|
|
|
(stop-when-reloaded)
|
|
|
|
(during (observe (ircd-credentials $nick $user $password _))
|
|
|
|
(log-info "Credentials: ~a ~a ~a" nick user password)
|
|
|
|
(assert (ircd-credentials nick user password (equal? password "foobar")))))
|