mautrix / imessage

A Matrix-iMessage puppeting bridge
https://go.mau.fi/mautrix-imessage/
GNU Affero General Public License v3.0
348 stars 37 forks source link

Support for Sending & Displaying Rich Links from BlueBubbles #210

Open joshuafhiggins opened 5 months ago

joshuafhiggins commented 5 months ago

Resolves #183

Adds support for sending messages with rich link data, by setting a flag that BlueBubbles forwards with the private-api for iMessage to scan the text for a link to include rich link data with. When receiving a message from BB with rich link data, the payloadData field in a message's JSON is filled out, but this JSON is hard to structure and parse (coming straight from the iMessage DB). The BB app parses this on the client in Dart in order to make it usable, see payload_data.dart. Instead, I opted to use a library to fetch the OpenGraph metadata for the link sent, as how iMessage would, and fill out the struct that way. Images that BB sends as attachments are still used for the rich link.