From 325e94dbdda471a5a46aab27de1b57cdd4370fd8 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Mon, 29 May 2023 00:41:32 -0500 Subject: [PATCH] PART/JOIN support w chatdir user-states --- irc-chatdir.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/irc-chatdir.scm b/irc-chatdir.scm index 1f2dcc2..3a73bbd 100755 --- a/irc-chatdir.scm +++ b/irc-chatdir.scm @@ -70,14 +70,22 @@ [(or (string=? cmd "NOTICE") (and (string=? cmd "PRIVMSG") (or (string-null? sender) (not (irc:hostmask? sender))))) - (chatdir:channel-message-add! root-dir ".server" (last params) "server")] + (chatdir:channel-message-add! root-dir ".server" (last params))] [(and (string=? cmd "JOIN") (irc:user-is-self? conn sender)) (chatdir:channel-add! root-dir (last params))] [(string=? cmd "JOIN") - (chatdir:channel-user-add! root-dir (last params) sender)])))) + (let ([channel (car params)] + [nick (irc:hostmask-nick sender)]) + (chatdir:channel-user-add! root-dir channel nick) + (chatdir:channel-user-toggle-states! root-dir channel nick + "online" "offline"))] + [(string=? cmd "PART") + (chatdir:channel-user-toggle-states! + root-dir (car params) (irc:hostmask-nick sender) + "offline" "online")])))) ;; [(string=? cmd "NICK") ;; (chatd-json-write conn ;; (compose-event-alist conn "user-info" #:user (last params)))])