Create ThreadView to track threads in a room #825
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is some initial work to make supporting threads easier. As part of the thread spec the root event gets some aggregation in the unsigned of the root event. However this is not automatically sync when the thread is started or a new message is added so we can't just rely on it's presence.
This leaves us with 2 options:
This PR does number 2.
A new
ThreadView
is created which holds a list ofThread
objects each representing the info for a single thread. As new events are added to the timeline each one is now checked to see if it is threaded and if so aThread
is either updated with the info as required or created if it is a previously unknown thread.This is intentionally a very simple start, I intend at some point for it to contain it's own timeline but before we can do that we would have to decide how we want to manage having the same event in multiple timelines.