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

various improvements to attachment bridging #2172

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ubq323
Copy link

@ubq323 ubq323 commented Aug 16, 2024

briefly:

  • discord attachments are kept in Extra["file"]
  • xmpp attachments will properly display inline in most clients
  • irc will not drop message body when sending an attachment

please see the full commit messages for more detail.

previously, the urls were just appended to the message content.

i couldn't find any other assignments directly to Extra["file"]
anywhere in the codebase, so maybe there's a better way to do this.
many clients will only display files inline if the message body
itself exactly matches the attachment URL.

see https://docs.modernxmpp.org/client/protocol/#communicating-the-url
previously, the code assumed each file had a Data, and crashed if this was not present.
now, we detect this condition, and send the URL instead.

the discord client will display URLs in a message of their own
as inline embeds, without any special behavior needed on our part.

this commit makes the same changes to the webhook and non-webhook code.
Copy link

codeclimate bot commented Aug 16, 2024

Code Climate has analyzed commit ce93d90 and detected 0 issues on this pull request.

View more on Code Climate.

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