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-28 13:50:49 +00:00
|
|
|
|
|
|
|
(require "protocol.rkt")
|
|
|
|
(require "message.rkt")
|
|
|
|
|
2020-04-27 18:27:48 +00:00
|
|
|
(require/activate syndicate/reload)
|
2019-01-28 13:50:49 +00:00
|
|
|
|
|
|
|
(spawn #:name 'channel-factory
|
|
|
|
(stop-when-reloaded)
|
2019-01-29 20:46:38 +00:00
|
|
|
|
|
|
|
(during (ircd-channel-member $Ch _)
|
|
|
|
(assert (ircd-channel Ch)))
|
|
|
|
|
|
|
|
(during/spawn (ircd-channel $Ch)
|
|
|
|
#:name (ircd-channel Ch)
|
2019-01-28 13:50:49 +00:00
|
|
|
(field [topic #f])
|
|
|
|
(assert (ircd-channel-topic Ch (topic)))
|
|
|
|
|
2019-01-29 20:47:06 +00:00
|
|
|
(define/query-count user-count (ircd-channel-member Ch $who) 'any)
|
|
|
|
(assert (ircd-channel-user-count Ch (hash-ref (user-count) 'any 0)))
|
|
|
|
|
2019-01-28 13:50:49 +00:00
|
|
|
(on (message (ircd-action $who (irc-message _ "MODE" (list Ch "b") _)))
|
|
|
|
(send! (ircd-event who (irc-message server-prefix 368 (list (lookup-nick who) Ch)
|
|
|
|
"End of Channel Ban List"))))
|
|
|
|
|
|
|
|
(on (message (ircd-action $who (irc-message _ "MODE" (list Ch) _)))
|
|
|
|
(send! (ircd-event who (irc-message server-prefix 324
|
|
|
|
(list (lookup-nick who) Ch "+") #f))))
|
|
|
|
|
|
|
|
(on (message (ircd-action _ (irc-message _ "TOPIC" (list Ch) $new-topic)))
|
|
|
|
(topic new-topic))))
|