From f84134962e2adfc2a96599978ff7f8ee78c22daf Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 26 Apr 2026 17:52:09 -0300 Subject: Hide +s/+p channels from LIST for non-members LIST now skips channels with the +s (secret) or +p (private) flag when the requesting client is not a member, matching Modern's secret-channel rule. --- src/papod.clj | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/papod.clj b/src/papod.clj index 83301fb..14957eb 100644 --- a/src/papod.clj +++ b/src/papod.clj @@ -3887,11 +3887,31 @@ "TAGMSG" (handle-tagmsg message client components) "MARKREAD" (handle-markread params client components) "LIST" (let [filter-ch (first params) + self (client-target client) chans (when (:channels components) @(:channels components)) + modes-of (fn [ch] + (or (get + @(:chan-modes + components) + ch) + "+nt")) + hidden? (fn [ch members] + (and (not + (contains? + members self)) + (let [m (modes-of + ch)] + (or + (string/includes? + m "s") + (string/includes? + m "p"))))) active (filter (fn [[ch members]] (and (seq members) + (not (hidden? + ch members)) (or (nil? filter-ch) (= ch filter-ch)))) chans)] -- cgit v1.3