diff options
| author | EuAndreh <eu@euandre.org> | 2026-04-26 17:25:20 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2026-04-26 17:25:20 -0300 |
| commit | 6aeb8d478182f4ff90884bf2a7eb3a812ec38e17 (patch) | |
| tree | 4dc0881ec526c9fa4024d3a974a0bb42b73e89d9 /src | |
| parent | REDACT: echo to sender, full nickmask prefix, FAIL format (diff) | |
| download | papod-6aeb8d478182f4ff90884bf2a7eb3a812ec38e17.tar.gz papod-6aeb8d478182f4ff90884bf2a7eb3a812ec38e17.tar.xz | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/papod.clj | 13 |
1 files changed, 12 insertions, 1 deletions
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 " |
