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

feat!(timeline): Allow to send attachments from bytes #4451

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zecakeh
Copy link
Collaborator

@zecakeh zecakeh commented Dec 21, 2024

Sometimes we can get the bytes directly, e.g. in Fractal we can get an image from the clipboard. It avoids to have to write the data to a temporary file only to have the data loaded back in memory by the SDK right after.

The first commit to accept any type that implements Into<String> for the filename is grouped here because it simplifies slightly the second commit.

Note that we could also use AttachmentSource in the other send_attachment APIs, on Room and RoomSendQueue, for consistency.

@zecakeh zecakeh requested a review from a team as a code owner December 21, 2024 15:37
@zecakeh zecakeh requested review from jmartinesp and removed request for a team December 21, 2024 15:37
Copy link

codecov bot commented Dec 21, 2024

Codecov Report

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

Project coverage is 85.06%. Comparing base (adb4428) to head (2a0973f).

Files with missing lines Patch % Lines
crates/matrix-sdk-ui/src/timeline/futures.rs 80.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4451   +/-   ##
=======================================
  Coverage   85.06%   85.06%           
=======================================
  Files         283      283           
  Lines       31748    31766   +18     
=======================================
+ Hits        27005    27021   +16     
- Misses       4743     4745    +2     

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

@poljar poljar requested review from poljar and removed request for jmartinesp December 22, 2024 16:20
…chment filename

Since we need a String as final type, this can avoid to allocate a string if the provided type is already a String.

Signed-off-by: Kévin Commaille <[email protected]>
Sometimes we can get the bytes directly. It avoids to have to write the data to a temporary file only to have the data loaded back in memory right after.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh force-pushed the timeline-send-attachment-bytes branch from c47466a to 2a0973f Compare December 22, 2024 17:25
@zecakeh
Copy link
Collaborator Author

zecakeh commented Dec 22, 2024

Added changelog entries in the commits.

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.

1 participant