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

[Feature Request] Add support for attachment caption #1601

Open
Thireus opened this issue Oct 4, 2024 · 0 comments
Open

[Feature Request] Add support for attachment caption #1601

Thireus opened this issue Oct 4, 2024 · 0 comments

Comments

@Thireus
Copy link

Thireus commented Oct 4, 2024

Caption is currently implemented for ReceiveMessageHandler.java:

writer.println("Caption: {}", attachment.caption().get());

And also implemented here:

final var caption = attachment.caption().orElse(null);

While the attachment JSON format supports it, it is currently not possible to set caption for uploaded attachments as it is missing from JSON RPC, CLI options and DBUS. And the function that would need to parse the caption (if any is attached) is defined here:

https://github.com/AsamK/signal-cli/blob/master/lib/src/main/java/org/asamk/signal/manager/util/AttachmentUtils.java#L30-L40

I propose a new --attachment-metadata (-am) vector option where the user could define the additional metadata for each attachment. For example, if 4 attachments are present:

-am '[{"caption":"image1_caption"}, None, {"width":800, "height":600}, {"caption":"image4_caption", "width":800, "height":600}]'

  • attachment 1 would receive caption "image1_caption"
  • attachment 2 has no additional metadata
  • attachment 3 has width set to 800 and height set to 600
  • attachment 4 has caption "image4_caption" and has width set to 800 and height set to 600

This would allow not only to support caption but also additional metadata such as voiceNote, borderless, preview, width, height, custom_filename, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants