-
Notifications
You must be signed in to change notification settings - Fork 260
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
room names: better make use of the hero names for locally computing a room display name #3461
Conversation
This patch does 3 things: 1. It updates Ruma to the latest revision at the time of writing, 2. It updates `matrix-sdk-ffi` to provide the `RoomSubscription::include_heroes` field, 3. It updates `matrix-sdk-base` so that SlidingSync consumes `heroes` from the response and update the `RoomSummary` accordingly. A test has been added to ensure the `RoomSummary` is updated as expected.
Since rendering is sync, and I want the computed display name (which retrieval is async), I have to fetch the display name early, just after getting the room. Oh well :)
This is the right goal, and Ruma will be updated to reflect that the `heroes` field should contain `OwnedUserId` too in [1]. This simplifies the code a bit, and avoids a round-trip encoding user-ids into a string then decoding them from a string later, in the case of sliding sync and room name computation. [1] ruma/ruma#1822
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3461 +/- ##
=======================================
Coverage 83.28% 83.29%
=======================================
Files 248 248
Lines 25198 25220 +22
=======================================
+ Hits 20987 21007 +20
- Misses 4211 4213 +2 ☔ View full report in Codecov by Sentry. |
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 think we are good with these patches. Thanks for digging into this!
|
||
let members: StoreResult<Vec<_>> = members.into_iter().collect(); | ||
let (heroes, guessed_num_members): (Vec<String>, _) = if !summary.heroes_names.is_empty() { | ||
// Straight-forward path: pass through the heroes names, don't give a guess of |
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.
- Straight-forward
+ Straightforward
Signed-off-by: Benjamin Bouvier <[email protected]>
Address part of #3272. |
This is #3441 but since I've added many commits while taking it over, reopening a new PR for it.
This makes it so that we prefer using the hero names if we receive those from the sliding sync, rather than retrieving the names from the room members that are hero, or retrieving the room members from the first N members.
I've also updated the very unfortunate edge case where we have 0 heroes to display "n people" instead of ", and n others.".