mautrix / imessage

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

Shared links sometimes generate attachment with message #183

Open rollingonchrome opened 4 months ago

rollingonchrome commented 4 months ago

Links sent or received via iMessage using the BlueBubbles connector sometimes generate an attachment (see attached file) that contains the following message:

{"status":500,"message":"The server has encountered an error","error":{"type":"Server Error","message":"Attachment does not exist in disk!"}}

Note, that I added the .txt file extension so I could upload it.

42359206-E37B-4F29-8A48-2AF37E48522D.pluginPayloadAttachment.txt

dltacube commented 4 months ago

Any idea if this always happens or only w/ a specific type of attachment?

dltacube commented 4 months ago

Ignore what I previously wrote, I imagined it.

Do you know if this worked with a different bridge control + bridge combo? Or when we weren't running bridges and it was all in the cloud? I'm looking for any clues that a happy path might already exist and if not then it needs a parser. I collected raw data to get a sense of what a proper preview should look like so there's progress.

dltacube commented 4 months ago

Looks like there might be a flag in either the client or server code called ddScan. It is possible that crafting rich links was never implemented (talking to someone on their discord) so I'll start by looking at the bb config.

joshuafhiggins commented 2 months ago

Is there any benefit to supporting rich links? Doesn't the Beeper/Element client make them look pretty anyway by loading them up on the clients themselves?

joshuafhiggins commented 2 months ago

Looks like there might be a flag in either the client or server code called ddScan. It is possible that crafting rich links was never implemented (talking to someone on their discord) so I'll start by looking at the bb config.

dltacube, how far have you looked into this? It also seems that the BB connector never implemented it, there's a "TODO Richlinks" in api.go

dltacube commented 2 months ago

Looks like there might be a flag in either the client or server code called ddScan. It is possible that crafting rich links was never implemented (talking to someone on their discord) so I'll start by looking at the bb config.

dltacube, how far have you looked into this? It also seems that the BB connector never implemented it, there's a "TODO Richlinks" in api.go

Whatever I'm thinking about in terms of these features will need to be fleshed out on our end. I've dug deep into bbb's output using web sockets and honestly if you point to the problematic ones I'll tell you how they behave.

joshuafhiggins commented 2 months ago

Whatever I'm thinking about in terms of these features will need to be fleshed out on our end. I've dug deep into bbb's output using web sockets and honestly if you point to the problematic ones I'll tell you how they behave.

Do you know what the UID values mean in the JSON for the payloadData object? Here's an example message: data.json

Parsing this is a mess and the BB app implementation looks nothing like this is way simpiler but I have no idea how to get this JSON instead of what the server sent above:


"payloadData": {
          "type": 0,
          "urlData": [
               {
                    "imageMetadata": {
                         "size": "Size(0.0, 0.0)",
                         "URL": {
                              "NS.relative": "https://jsonformatter.curiousconcept.com/icons/jf/mstile-144x144.b0ef4bd01d6cb25ab71ae707ed7ac226.png"
                         }
                    },
                    "videoMetadata": null,
                    "iconMetadata": {
                         "size": "Size(0.0, 0.0)",
                         "URL": {
                              "NS.relative": "https://jsonformatter.curiousconcept.com/icons/jf/apple-touch-icon.g79xknzqx7c.png"
                         }
                    },
                    "itemType": "website",
                    "originalURL": {
                         "NS.relative": "https://jsonformatter.curiousconcept.com/#"
                    },
                    "URL": {
                         "NS.relative": "https://jsonformatter.curiousconcept.com/"
                    },
                    "title": "JSON Formatter & Validator",
                    "summary": "Format and validate JSON data so that it can easily be read by human beings.",
                    "siteName": null
               }
          ],
          "appData": null
     }
`