-
Notifications
You must be signed in to change notification settings - Fork 285
feat(send_queue): Implement sending of MSC4274 galleries #4977
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Johannes Marbach <[email protected]>
ba8aa4b
to
0c3161b
Compare
let info = assign!(info.map(ImageInfo::from).unwrap_or_default(), { | ||
mimetype: Some(content_type.as_ref().to_owned()), | ||
thumbnail_source, | ||
thumbnail_info | ||
}); | ||
let content = assign!(ImageMessageEventContent::new(body, source), { | ||
info: Some(Box::new(info)), | ||
formatted: formatted_caption, | ||
filename | ||
}); |
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.
These blocks could maybe share the logic with make_attachment_type
by extracting a function to create the content for each mime-type? I wasn't sure if it's really worth it because it might not be shorter due to the number of arguments on the call.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4977 +/- ##
==========================================
+ Coverage 85.91% 85.94% +0.02%
==========================================
Files 325 325
Lines 35697 35699 +2
==========================================
+ Hits 30670 30681 +11
+ Misses 5027 5018 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm mindful that it's probably just a matter of lack of time but if there's anything I can do to simplify reviewing this PR, I'd be happy to follow any suggestions. |
This was broken out of #4838 and is a step towards implementing MSC4274.
RoomSendQueue::send_gallery
was added to handle the sending of galleriesDependentQueuedRequestKind::FinishGallery
handels the sending of the final eventRoom::make_attachment_event
was renamed tomake_message_event
because it is now reused to create gallery events as wellThis is relatively large, unfortunately, but including everything needed to actually send the event made it possible to also add a test for it. It would be nice if the amount of new code could be reduced but I'm struggling a bit to find ways to integrate galleries with the existing media uploads further.