Skip to content
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

timeline: use the previous content's membership info when it's missing from the current membership event #3648

Merged

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Jul 3, 2024

Synapse returns a bare { "membership": "leave" } as the content of a room membership event (for leave membership changes and likely others). In this case, it'd still be nice to have some kind of display name/avatar URL to show in UIs; it's possible to reuse information from the previous member event, if available.

@bnjbvr bnjbvr requested a review from a team as a code owner July 3, 2024 15:05
@bnjbvr bnjbvr requested review from Hywan and removed request for a team July 3, 2024 15:05
Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.26%. Comparing base (07b6425) to head (61be6e8).

Files Patch % Lines
...trix-sdk-ui/src/timeline/event_item/content/mod.rs 83.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3648   +/-   ##
=======================================
  Coverage   84.25%   84.26%           
=======================================
  Files         259      259           
  Lines       26609    26621   +12     
=======================================
+ Hits        22420    22431   +11     
- Misses       4189     4190    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. Thanks for the clean up too.
I like the fact we have less logics in FFI.

@@ -201,6 +201,48 @@ async fn test_room_member() {
assert_matches!(profile.displayname_change(), Some(_));
assert_matches!(profile.avatar_url_change(), None);

let mut fourth_room_member_content = RoomMemberEventContent::new(MembershipState::Join);
fourth_room_member_content.displayname = Some("Alice In Wonderland".to_owned());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐰

@jmartinesp
Copy link
Contributor

This requires adding an exception client-side (at least for EX Android) but I confirm it works as expected. Thanks!

@bnjbvr bnjbvr enabled auto-merge (rebase) July 4, 2024 14:51
@bnjbvr
Copy link
Member Author

bnjbvr commented Jul 4, 2024

Thanks for testing! will land the first part, and see how we can improve the disambiguation mappings.

…g from the current membership event

Synapse returns a bare `{ "membership": "leave" }` as the content of a
room membership event (for leave membership changes and likely others).
In this case, it'd still be nice to have some kind of display
name/avatar URL to show in UIs; it's possible to reuse information from
the previous member event, if available.
@bnjbvr bnjbvr force-pushed the bnjbvr/timeline-item-displayname-or-avatar-from-prev-content branch from b5e8cf2 to 61be6e8 Compare July 4, 2024 14:55
@bnjbvr bnjbvr merged commit b80c2f7 into main Jul 4, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/timeline-item-displayname-or-avatar-from-prev-content branch July 4, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants