1
0
Disbranĉigi 0

Support for private messages

This commit is contained in:
Jaidyn Ann 2023-06-06 11:33:31 -05:00
parent 1affe55063
commit 99c9452479

View File

@ -24,7 +24,7 @@
(chicken file) (chicken file posix) (chicken io) (chicken pathname) (chicken file) (chicken file posix) (chicken io) (chicken pathname)
(chicken process-context) (chicken process-context posix) (chicken process-context) (chicken process-context posix)
(chicken string) (chicken string)
srfi-1 srfi-18 srfi-69 srfi-1 srfi-13 srfi-18 srfi-69
(prefix chatdir chatdir:) (prefix chatdir-inotify chatdir:) (prefix chatdir chatdir:) (prefix chatdir-inotify chatdir:)
ircc ircc
getopt-long) getopt-long)
@ -60,6 +60,7 @@
(cond (cond
[(and (string=? cmd "PRIVMSG") [(and (string=? cmd "PRIVMSG")
(string? sender) (string? sender)
(irc:channel? (car params))
(irc:hostmask? sender)) (irc:hostmask? sender))
(let ([target (if (irc:user-is-self? conn (car params)) (let ([target (if (irc:user-is-self? conn (car params))
(irc:hostmask-nick sender) (irc:hostmask-nick sender)
@ -67,6 +68,13 @@
(chatdir:channel-message-add! root-dir target (chatdir:channel-message-add! root-dir target
(last params) (irc:hostmask-nick sender)))] (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") [(or (string=? cmd "NOTICE")
(and (string=? cmd "PRIVMSG") (and (string=? cmd "PRIVMSG")
(or (string-null? sender) (not (irc:hostmask? sender))))) (or (string-null? sender) (not (irc:hostmask? sender)))))