From 6aeb8d478182f4ff90884bf2a7eb3a812ec38e17 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 26 Apr 2026 17:25:20 -0300 Subject: Filter non-message events from CHATHISTORY without event-playback When the client has the draft/event-playback capability we still emit JOIN/KICK/etc. in the historical batch; otherwise we now restrict the batch to user-message / user-edit / user-delete events, matching the chathistory spec. --- src/papod.clj | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/papod.clj b/src/papod.clj index 8624cfa..ec4265b 100644 --- a/src/papod.clj +++ b/src/papod.clj @@ -2454,7 +2454,18 @@ (let [limit (try (Long/parseLong (last params)) (catch Exception _ 50)) - events (fetch-history db chan-eid 0 limit) + event-playback? + (contains? (or (:caps @client) #{}) + "draft/event-playback") + all-events (fetch-history db chan-eid 0 limit) + events (if event-playback? + all-events + (filter + (fn [[_ type & _]] + (#{"user-message" + "user-edit" + "user-delete"} type)) + all-events)) batch-id (str (java.util.UUID/randomUUID))] (into [(str "BATCH +" batch-id " chathistory " -- cgit v1.3