Only autojoin channels specifically marked as such

… with a symbolic link from the chatdir root to
/.meta/autojoin/.
This commit is contained in:
Jaidyn Ann 2023-06-07 13:17:57 -05:00
parent 5248c4b32d
commit 61c7add3f1

View File

@ -18,9 +18,9 @@
(input-loop input-loop-init) (input-loop input-loop-init)
(import scheme (import scheme
(chicken base) (chicken condition) (chicken file) (chicken io) (chicken base) (chicken condition) (chicken file) (chicken file posix)
(chicken pathname) (chicken io) (chicken pathname)
srfi-1 srfi-1
(prefix inotify inotify:)) (prefix inotify inotify:))
@ -50,12 +50,11 @@
(inotify:add-watch! (inotify:add-watch!
root-dir '(onlydir moved-to moved-from delete delete-self create)) root-dir '(onlydir moved-to moved-from delete delete-self create))
;; Auto-join channels with all pre-existing channel directories ;; Auto-join channels linked to the .meta/autojoin directory.
(map (lambda (path) (map (lambda (path)
(let ([channel (pathname-file (let ([channel (pathname-file (read-symbolic-link path))])
(pathname-directory (string-append path "/")))])
(join-channel root-dir callbacks-alist channel))) (join-channel root-dir callbacks-alist channel)))
(filter directory-exists? (directory-rel root-dir))))) (directory-rel (subpath root-dir ".meta" "autojoin")))))
;; Handle a single inotify file event, as part of the input loop ;; Handle a single inotify file event, as part of the input loop