feat(thread_list): latest events, number of replies and automatic updates#6335
Open
stefanceriu wants to merge 2 commits intostefan/threadListServicefrom
Open
feat(thread_list): latest events, number of replies and automatic updates#6335stefanceriu wants to merge 2 commits intostefan/threadListServicefrom
stefanceriu wants to merge 2 commits intostefan/threadListServicefrom
Conversation
…_replies Introduce ThreadListItemEvent as a shared struct for both the thread root and the latest reply, replacing the previous flat fields on ThreadListItem The `latest_event` is populated from the bundled thread summary returned by the server alongside the root event, as is the number of replies.
When ThreadListService is created it now immediately spawns a background task (via the client's TaskMonitor) that subscribes to the room event cache and listens for RoomEventCacheUpdate::UpdateTimelineEvents. For every incoming event that carries an m.thread relation pointing to a root we are already tracking, the service rebuilds a ThreadListItemEvent via the existing build_latest_event helper and replaces latest_event on the matching ThreadListItem and increments num_replies by 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 a continuation of #6311 which refactors the ThreadListItems to hold both the root event as well as the latest one and the total number of replies for that particular thread.
Along side those additions, this PR also starts a background taks on service construction that listens to the event cache and automatically updates the list of threads, their latest events and number of replies.
Part of #6290
CHANGELOG.mdfiles.