From 61c7add3f1f478cf29be4f44e07f6c49f1ff7912 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Wed, 7 Jun 2023 13:17:57 -0500 Subject: [PATCH] Only autojoin channels specifically marked as such MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … with a symbolic link from the chatdir root to /.meta/autojoin/. --- inotify.scm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/inotify.scm b/inotify.scm index 0ff612a..5617efa 100644 --- a/inotify.scm +++ b/inotify.scm @@ -18,9 +18,9 @@ (input-loop input-loop-init) (import scheme - (chicken base) (chicken condition) (chicken file) (chicken io) - (chicken pathname) - srfi-1 + (chicken base) (chicken condition) (chicken file) (chicken file posix) + (chicken io) (chicken pathname) + srfi-1 (prefix inotify inotify:)) @@ -50,12 +50,11 @@ (inotify:add-watch! 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) - (let ([channel (pathname-file - (pathname-directory (string-append path "/")))]) + (let ([channel (pathname-file (read-symbolic-link path))]) (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