Send an outbound attachment to the endpoint its type belongs to

FixMediaService
Shipped
August 13, 2026 at 5:22 AM UTC
Author
Kamo
Commit
d01ef68

Every social attachment went out through the adapter's sendImage, which on Telegram is /sendPhoto. A PDF or a zip posted there is rejected by the provider, and the rejection arrives long after the HTTP response has told the agent their message went out — so a receipt sent to a customer appeared in the agent's own window and never arrived at the other end. Route by what the file actually is: image, audio and video keep their own endpoints, everything else travels as a document. SVG is deliberately a document, matching how the chat renders it. When the MIME is missing or generic the extension decides, and an unknown file still sends — as a file, the one kind every provider accepts for arbitrary content. Also log when a message carries more than one attachment: only the first can be relayed, because a message holds a single MediaObjSocialRef.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing