mautrix / whatsapp

A Matrix-WhatsApp puppeting bridge
https://maunium.net/go/mautrix-whatsapp
GNU Affero General Public License v3.0
1.26k stars 172 forks source link

Bridge sends invalid stickers #662

Closed jplatte closed 11 months ago

jplatte commented 11 months ago

Apparently, this event (seemingly with event ID and possibly other things redacted) was sent by mautix-whatsapp:

{
  "room_id": "censor",
  "type": "m.sticker",
  "content": {
    "body": "image.webp",
    "file": {
      "hashes": {
        "sha256": "censor"
      },
      "iv": "censor",
      "key": {
        "alg": "A256CTR",
        "ext": true,
        "k": "censor",
        "key_ops": [
          "encrypt",
          "decrypt"
        ],
        "kty": "oct"
      },
      "url": "mxc://fuo.fi/censor",
      "v": "v2"
    },
    "info": {
      "h": 190,
      "mimetype": "image/webp",
      "size": 29502,
      "thumbnail_file": {
        "hashes": {
          "sha256": "censor"
        },
        "iv": "censor",
        "key": {
          "alg": "A256CTR",
          "ext": true,
          "k": "censor",
          "key_ops": [
            "encrypt",
            "decrypt"
          ],
          "kty": "oct"
        },
        "url": "mxc://fuo.fi/censor",
        "v": "v2"
      },
      "thumbnail_info": {
        "h": 190,
        "mimetype": "image/webp",
        "size": 29502,
        "w": 190
      },
      "w": 190
    }
  }
}

(reported here in the Element X iOS room)

It has a url field, but nested under content -> file while the spec says that m.sticker must have a url under content directly.

tulir commented 11 months ago

That's encrypted, not invalid

jplatte commented 11 months ago

Is there an MSC for that?

tulir commented 11 months ago

More of a spec omission/mistake than a MSC. Stickers are just m.images with their own event type, so all the same fields apply and file was probably just missed while copying the schema. The info schema was not duplicated, so thumbnail_file is already there.

jplatte commented 11 months ago

Okay, thanks for the quick replies.