Skip to content

Add Matrix m.emote (/me) message support

Eric Eastwood requested to merge 2673-add-matrix-emote-message-support into develop

Add Matrix m.emote (/me) message support

Part of #2673 (closed)

Other related MR for the Gitter half of the support: !2094 (merged)

This is how a /me message from Matrix ends up looking on Gitter:

Testing strategy

  1. From matrix, send /me says hi (you can also test HTML content like a mention)
  2. On Gitter, notice that it is a status message

Dev notes

onEventData { age: 223,
  content: { body: 'asdf', msgtype: 'm.emote' },
  event_id: '$HF-RfYKY_RU4f6seGHXN2PsRg6awFm-c17Izs3BfmQ4',
  origin_server_ts: 1607044282167,
  room_id: '!seyNEQRDccKBWPkzCc:my.matrix.host',
  sender: '@root:my.matrix.host',
  type: 'm.room.message',
  unsigned: { age: 223 },
  user_id: '@root:my.matrix.host' }
onEventData { age: 181,
  content:
   { body: 'says hi to MadLittleMods (Eric Eastwood) and waves',
     format: 'org.matrix.custom.html',
     formatted_body:
      'says hi to <a href="https://matrix.to/#/@MadLittleMods-5f762e89986e461e663059c2:my.matrix.host">MadLittleMods (Eric Eastwood)</a> and waves',
     msgtype: 'm.emote' },
  event_id: '$5hF_wyZgxSYMtLq2aYUaUSpOTGYDvQIgckIR6jJKtM0',
  origin_server_ts: 1607045712962,
  room_id: '!seyNEQRDccKBWPkzCc:my.matrix.host',
  sender: '@root:my.matrix.host',
  type: 'm.room.message',
  unsigned: { age: 181 },
  user_id: '@root:my.matrix.host' }

edit:

onEventData { age: 183,
  content:
   { body: ' * awfefew ewe',
     'm.new_content': { body: 'awfefew ewe', msgtype: 'm.emote' },
     'm.relates_to':
      { event_id: '$-2V1O4ZGgN6rDRJIBHjOhnoLuYrpbYDaFGxXF3Gf7AU',
        rel_type: 'm.replace' },
     msgtype: 'm.emote' },
  event_id: '$OICZiFz461E_GoUAEsq1iUxzG85JEfBkoTtQMlk3jQk',
  origin_server_ts: 1607047230528,
  room_id: '!seyNEQRDccKBWPkzCc:my.matrix.host',
  sender: '@root:my.matrix.host',
  type: 'm.room.message',
  unsigned: { age: 183 },
  user_id: '@root:my.matrix.host' }
Edited by Eric Eastwood

Merge request reports