From 99c94524796b6d0a3b8228ffec39143a7008bf8e Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:33:31 -0500 Subject: [PATCH] Support for private messages --- irc-chatdir.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/irc-chatdir.scm b/irc-chatdir.scm index b6fd38e..db15316 100755 --- a/irc-chatdir.scm +++ b/irc-chatdir.scm @@ -24,7 +24,7 @@ (chicken file) (chicken file posix) (chicken io) (chicken pathname) (chicken process-context) (chicken process-context posix) (chicken string) - srfi-1 srfi-18 srfi-69 + srfi-1 srfi-13 srfi-18 srfi-69 (prefix chatdir chatdir:) (prefix chatdir-inotify chatdir:) ircc getopt-long) @@ -60,6 +60,7 @@ (cond [(and (string=? cmd "PRIVMSG") (string? sender) + (irc:channel? (car params)) (irc:hostmask? sender)) (let ([target (if (irc:user-is-self? conn (car params)) (irc:hostmask-nick sender) @@ -67,6 +68,13 @@ (chatdir:channel-message-add! root-dir target (last params) (irc:hostmask-nick sender)))] + [(and (string=? cmd "PRIVMSG") + (string? sender) + (irc:hostmask? sender)) + (chatdir:channel-add! root-dir (irc:hostmask-nick sender)) + (chatdir:channel-message-add! root-dir (irc:hostmask-nick sender) + (last params) (irc:hostmask-nick sender))] + [(or (string=? cmd "NOTICE") (and (string=? cmd "PRIVMSG") (or (string-null? sender) (not (irc:hostmask? sender)))))