matrix: Support message edits
Description
We should be able to able
- edit our own messages
- have the original message changed/updated in the chatview
More information (example)
Sending a
and after editing not a, but b
ends up with something like messages like
Original message
{
"type": "m.room.message",
"sender": "@devrtz:fortysixandtwo.eu",
"content": {
"org.matrix.msc1767.text": "a",
"body": "a",
"msgtype": "m.text"
},
"origin_server_ts": 1660314997607,
"unsigned": {
"age": 461,
"transaction_id": "m1660314997526.87"
},
"event_id": "$jnA0l-DugQ9Yz4CqRLyIr2odwwHd-8j4AIohepWeg_k",
"room_id": "!ACTJKpMndcucStIjRl:fortysixandtwo.eu"
}
Editing previous message
{
"type": "m.room.message",
"sender": "@devrtz:fortysixandtwo.eu",
"content": {
"org.matrix.msc1767.text": " * not a, but b",
"body": " * not a, but b",
"msgtype": "m.text",
"m.new_content": {
"org.matrix.msc1767.text": "not a, but b",
"body": "not a, but b",
"msgtype": "m.text"
},
"m.relates_to": {
"rel_type": "m.replace",
"event_id": "$jnA0l-DugQ9Yz4CqRLyIr2odwwHd-8j4AIohepWeg_k"
}
},
"origin_server_ts": 1660315050251,
"unsigned": {
"age": 435,
"transaction_id": "m1660315050080.88"
},
"event_id": "$EZqR6sHLv1NsiPEbXIDdTNnFub4Uv8VFPBSy4o1QAEM",
"room_id": "!ACTJKpMndcucStIjRl:fortysixandtwo.eu"
}