From f56b96b0ff0b023cdada6c25f6e22bcf43fdf1ca Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 7 May 2020 19:14:53 +0200 Subject: [PATCH] add some ideas for relations --- doc/impl-thoughts/RELATIONS.md | 2 ++ src/matrix/room/timeline/Timeline.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/doc/impl-thoughts/RELATIONS.md b/doc/impl-thoughts/RELATIONS.md index b1146b6c..c7886024 100644 --- a/doc/impl-thoughts/RELATIONS.md +++ b/doc/impl-thoughts/RELATIONS.md @@ -10,3 +10,5 @@ alternatively, SyncWriter/SendQueue could have a section with updatedEntries apa SendQueue will need to pass the non-sent state (redactions & relations) about an event that has it's remote echo received to the SyncWriter so it doesn't flash while redactions and relations for it still have to be synced. Also, related ids should be processed recursively. If event 3 is a redaction of event 2, a reaction to event 1, all 3 entries should be considered as updated. + +As a UI for reactions, we could show (👍 14 + 1) where the + 1 is our own local echo (perhaps style it pulsating and/or in grey?). Clicking it again would just show 14 and when the remote echo comes in it would turn into 15. diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index 95a39022..bd4874c5 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -29,6 +29,9 @@ export class Timeline { this._remoteEntries.setManySorted(entries); } + // TODO: should we rather have generic methods for + // - adding new entries + // - updating existing entries (redaction, relations) /** @package */ appendLiveEntries(newEntries) { this._remoteEntries.setManySorted(newEntries);