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

Media: Add support for media captions. #4081

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Oct 7, 2024

This PR makes 2 changes:

@pixlwave pixlwave requested a review from a team as a code owner October 7, 2024 10:27
@pixlwave pixlwave requested review from jmartinesp and removed request for a team October 7, 2024 10:27
event_content.filename = content.filename;
event_content.filename = Some(content.filename);
Copy link
Member Author

@pixlwave pixlwave Oct 7, 2024

Choose a reason for hiding this comment

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

I'm not 100% about these first 4 mappings going back to Ruma. Is it important to store the non-computed filename in the FFI type so that we can pass that back here, or is that an unnecessary step?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is technically only used for edits and media events can't have them AFAICT, so it might not be needed. However, I don't see the harm in passing it around in case we might need it in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added it back as raw_filename.

@pixlwave pixlwave force-pushed the doug/media-captions branch 3 times, most recently from 633d9b1 to 0c01fec Compare October 7, 2024 10:41
Copy link
Contributor

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

event_content.filename = content.filename;
event_content.filename = Some(content.filename);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is technically only used for edits and media events can't have them AFAICT, so it might not be needed. However, I don't see the harm in passing it around in case we might need it in the future.

@jmartinesp
Copy link
Contributor

The tests need some love though 😅 .

@pixlwave pixlwave force-pushed the doug/media-captions branch 2 times, most recently from 787a049 to 5519dae Compare October 7, 2024 11:17
@pixlwave
Copy link
Member Author

pixlwave commented Oct 7, 2024

Just updated adding in the formatted_caption field too which I forgot about. Let's see if the tests are more happy now 🤞

@pixlwave pixlwave force-pushed the doug/media-captions branch from 5519dae to 204c45e Compare October 7, 2024 11:40
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.67%. Comparing base (351fbf6) to head (204c45e).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4081      +/-   ##
==========================================
+ Coverage   84.66%   84.67%   +0.01%     
==========================================
  Files         269      269              
  Lines       28694    28694              
==========================================
+ Hits        24294    24297       +3     
+ Misses       4400     4397       -3     

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

@jmartinesp jmartinesp enabled auto-merge (rebase) October 7, 2024 12:00
@jmartinesp jmartinesp merged commit a12a46b into main Oct 7, 2024
41 checks passed
@jmartinesp jmartinesp deleted the doug/media-captions branch October 7, 2024 12:11
@@ -537,6 +543,7 @@ async fn test_sync_resumes_from_previous_state() -> Result<(), Error> {
"lists": {
ALL_ROOMS: {
"ranges": [[0, 9]],
"timeline_limit": 0,
Copy link
Member

@Hywan Hywan Oct 7, 2024

Choose a reason for hiding this comment

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

All these timeline_limit to 0 is a bug, fixed in #4039 :-).

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooops, I thought it was mocks not being fully fleshed out 🙈

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.

3 participants