-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create ThreadView to track threads in a room #825
Conversation
I happen to have the answer to the question about having the same event in several timelines. We really should separate the concerns of storing events and referencing them. Each room should have its own storage of events (could be unique pointers because we rarely delete events atm, but we could also use shared pointers or Qt's shared data paradigm); any event container (state or timeline) would then simply refer to the event. Event ids are obvious keys for the hash map storage, to find them whenever they are mentioned in sync/history batches. That really is it. It cannot be implemented without breaking the API because |
As it so happens this is exactly what I was thinking. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments on the current code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from all what I wrote above - once you are through with most of functionality, please add a test (or several), either as a unit test (I doubt that it's even possible though) or to quotest.cpp
. Happy to discuss the details.
f7b965d
to
f059e78
Compare
So I added some unit tests for Thread and a quotest for a basic thread, tell me if you want more. |
1cecf8d
to
acf7b60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really love where this is going. A few more things though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple brush-ups, and I think we're there.
e89799d
to
3084338
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a ton!
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.