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

Display file sizes for attachments #278

Merged
merged 3 commits into from
May 25, 2024
Merged

Conversation

Lugrim
Copy link
Contributor

@Lugrim Lugrim commented Apr 30, 2024

Hi, first PR to take a look at the code base of this project (and a bit more at matrix internals).

It displays the attachment file size by appending it in the displayed messages.
For example, it would show [Attached Image: Alt Text (12.34 kB)] or [Attached Image: Alt Text] if the size field is not present in the message information.

Adds the humansize crate to Cargo.toml.

Intends to fix #97

Untested for now.

May not work if `size` is not present in message content info.

Signed-off-by: Oror <foss@borale.si>
Signed-off-by: Oror <foss@borale.si>
Now using a `macro_rule!` to avoid code repetition.

Signed-off-by: Oror <foss@borale.si>
@ulyssa
Copy link
Owner

ulyssa commented May 25, 2024

This looks great! Thank you for adding more tests, too! 🙏

@ulyssa ulyssa changed the title Added attachment file size display Display file sizes for attachments May 25, 2024
@ulyssa ulyssa merged commit 497be7f into ulyssa:main May 25, 2024
3 checks passed
@ulyssa ulyssa mentioned this pull request Aug 21, 2024
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.

Show attachment file size
2 participants