mautrix / signal

A Matrix-Signal puppeting bridge
GNU Affero General Public License v3.0
499 stars 75 forks source link

Replies from signal possibly misplace `msgtype` not within the `content` block #447

Closed meson800 closed 7 months ago

meson800 commented 7 months ago

I recently updated from the Python to the current master Go branch. On the Go bridge, message replies appear blank (there is the blockquote of the thing you are replying to, but you can't see the text of the response), but only on Element on Android. Element Desktop renders this fine.

On the old Python bridge, a reply looked like:

{
  "room_id": "--removed--",
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "body": "blah blah blah",
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "--removed--"
      }
    },
    "format": "org.matrix.custom.html",
    "formatted_body": "blah blah blah"
  }
}

On the new Go bridge:

{
  "room_id": "--removed--",
  "type": "m.room.message",
  "content": {
    "body": "blah blah",
    "m.mentions": {
      "user_ids": [
        "@me:someserver.com"
      ]
    },
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "--removed--"
      }
    },
    "msgtype": "m.text"
  }
}

Looking at the event source, it seems like the msgtype is possibly misplaced. From the matrix-js-sdk pages:

  1. IRoomEvent expects a content field.
  2. The content field is a IContent, that expects a msgtype field.

I think this means that because the Go bridge's content block doesn't contain msgtype, Element Android is rendering it weirdly.

tulir commented 7 months ago

msgtype is right there inside content. Element Android just doesn't support rendering replies, and the bridge doesn't send reply fallbacks anymore. It's recommended to use Schildichat or Element X instead

meson800 commented 7 months ago

My bad, I misread the JSON indenting/curlies and thought it was outside.

I haven't switched to Element X because I use the Synapse/non-native OIDC and MAS doesn't support E2EE bridges, but I'll start taking a look.