-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message editing: attach message as reply to other message via Edit form #1047
Comments
UI/UX suggestion on how to do this: When user is editing a message, clicking on a reply (currently does nothing while editing) makes the current message a reply. We also need to think about disengaging a reply (accidentally replied, when meant to send a non-reply). Problem is, that X might be misinterpreted as 'cancel editing'. Instead of using the X icon, I'd use the symbol, but with something to indicate, that it's for unlinking (I have seen it before, there's something happening in the middle of the chain, a zap or something). |
Related element-hq/element-web#2349 (If implementing this, consider that in the future, one should be able to move messages in and out of threads. Make it modular and make the next person's life easier.) The best way to implement this is probably a 'hidden head tag', what says 'this message is attached to (reply of) message id x, in thread y'. |
API-wise, is it even possible to add Related MSC discussion: matrix-org/matrix-spec-proposals#2676 (comment) Original events: {
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "Reply to this message"
},
"sender": "@madlittlemods:matrix.org",
"event_id": "$ensh3G0vNNxYR6tTkR4D3K0RHzJteaGZerkd-GQIWd8",
"room_id": "!vaRuaHMtoPkUtcRtCV:matrix.org"
} {
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "foo"
},
"sender": "@madlittlemods:matrix.org",
"event_id": "$Bl7NMSBwW-YSjfnpvd_f5ET2bUr_M4nk4315Q-89ZzQ",
"room_id": "!vaRuaHMtoPkUtcRtCV:matrix.org"
} And here is what the timeline looks like before any edits: For reference: What does a normal message look like with a `m.in_reply_to`{
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "> <@madlittlemods:matrix.org> Reply to this message\n\nfoo",
"format": "org.matrix.custom.html",
"formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!vaRuaHMtoPkUtcRtCV:matrix.org/$BNJlsM_mfjrvzDMbJ7TUp_YZHeGGRYkIFulQXGp_aJs?via=matrix.org&via=gitter.im&via=vector.modular.im\">In reply to</a> <a href=\"https://matrix.to/#/@madlittlemods:matrix.org\">@madlittlemods:matrix.org</a><br>Reply to this message</blockquote></mx-reply>foo",
"m.relates_to": {
"m.in_reply_to": {
"event_id": "$BNJlsM_mfjrvzDMbJ7TUp_YZHeGGRYkIFulQXGp_aJs"
}
}
},
"sender": "@madlittlemods:matrix.org",
"event_id": "$xz3ODvwgG7pKolVelsLI33zgFK0tXTa904-cwwTb6Ck",
"room_id": "!vaRuaHMtoPkUtcRtCV:matrix.org"
} What does a edited message look like with a `m.in_reply_to`{
"type": "m.room.message",
"content": {
"m.new_content": {
"msgtype": "m.text",
"body": "foo bar",
"format": "org.matrix.custom.html",
"formatted_body": "foo bar"
},
"m.relates_to": {
"rel_type": "m.replace",
"event_id": "$xz3ODvwgG7pKolVelsLI33zgFK0tXTa904-cwwTb6Ck"
},
"msgtype": "m.text",
"body": "> <@madlittlemods:matrix.org> Reply to this message\n\n * foo bar",
"format": "org.matrix.custom.html",
"formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!vaRuaHMtoPkUtcRtCV:matrix.org/$BNJlsM_mfjrvzDMbJ7TUp_YZHeGGRYkIFulQXGp_aJs?via=matrix.org&via=gitter.im&via=vector.modular.im\">In reply to</a> <a href=\"https://matrix.to/#/@madlittlemods:matrix.org\">@madlittlemods:matrix.org</a><br>Reply to this message</blockquote></mx-reply> * foo bar"
},
"sender": "@madlittlemods:matrix.org",
"event_id": "$l246fF0IBQNLqkVWoGcXhF8tLops024pWMUJDAI_2_Y",
"room_id": "!vaRuaHMtoPkUtcRtCV:matrix.org"
} Edit message to just add the
|
…Event As discovered in https://github.com/vector-im/element-web/issues/10391#is Previously, if you turned on the `showHiddenEventsInTimeline` labs flag, edit (`m.replace`) events that also have a `m.in_reply_to` field, will show the reply in the timeline. ex. ``` { "type": "m.room.message", "content": { "body": " * foo", "msgtype": "m.text", "m.new_content": { "body": "foo", "msgtype": "m.text" }, "m.relates_to": { "rel_type": "m.replace", "event_id": "$yvuev9bF2nLRf8fscG55njpVjY3FHJzWgZ4BKI9_0eg", "m.in_reply_to": { "event_id": "$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og" } } } } ```
…eEvent` (#6796) As discovered in https://github.com/vector-im/element-web/issues/10391#is Previously, if you turned on the `showHiddenEventsInTimeline` labs flag, edit (`m.replace`) events that also have a `m.in_reply_to` field, will show the reply in the timeline. ex. ``` { "type": "m.room.message", "content": { "body": " * foo", "msgtype": "m.text", "m.new_content": { "body": "foo", "msgtype": "m.text" }, "m.relates_to": { "rel_type": "m.replace", "event_id": "$yvuev9bF2nLRf8fscG55njpVjY3FHJzWgZ4BKI9_0eg", "m.in_reply_to": { "event_id": "$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og" } } } } ```
Part of https://github.com/vector-im/element-web/issues/10391#issuecomment-906131724 When `m.relates_to` -> `m.in_reply_to` is provided in `m.new_content` for an edited message, use the updated reply. ex. ```json { "type": "m.room.message", "content": { "body": " * foo bar", "msgtype": "m.text", "m.new_content": { "body": "foo bar", "msgtype": "m.text", "m.relates_to": { "m.in_reply_to": { "event_id": "$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og" } } }, "m.relates_to": { "rel_type": "m.replace", "event_id": "$lX9MRe9ZTFOOvnU8PRVbvr1wqGtYvNQ1rSot-iUTN5k" } } } ```
As an update, the reply artifact was caused by having the "Show hidden events" lab turned on a bug where the tile still showed replies for hidden events. The bug was fixed by matrix-org/matrix-react-sdk#6796 In terms of actually getting the edited relation reply to show up, I think I just had the event format wrong. Instead of adding {
"type": "m.room.message",
"content": {
"body": " * foo bar",
"msgtype": "m.text",
"m.new_content": {
"body": "foo bar",
"msgtype": "m.text",
"m.relates_to": {
"m.in_reply_to": {
"event_id": "$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og"
}
}
},
"m.relates_to": {
"rel_type": "m.replace",
"event_id": "$lX9MRe9ZTFOOvnU8PRVbvr1wqGtYvNQ1rSot-iUTN5k"
}
}
} |
Part of https://github.com/vector-im/element-web/issues/10391#issuecomment-906131724 When `m.relates_to` -> `m.in_reply_to` is provided in `m.new_content` for an edited message, use the updated reply. ex. ```json { "type": "m.room.message", "content": { "body": " * foo bar", "msgtype": "m.text", "m.new_content": { "body": "foo bar", "msgtype": "m.text", "m.relates_to": { "m.in_reply_to": { "event_id": "$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og" } } }, "m.relates_to": { "rel_type": "m.replace", "event_id": "$lX9MRe9ZTFOOvnU8PRVbvr1wqGtYvNQ1rSot-iUTN5k" } } } ```
Part of https://github.com/vector-im/element-web/issues/10391 When `m.relates_to` -> `m.in_reply_to` is provided in `m.new_content` for an edited message, use the updated reply. ex. ```json { "type": "m.room.message", "content": { "body": " * foo bar", "msgtype": "m.text", "m.new_content": { "body": "foo bar", "msgtype": "m.text", "m.relates_to": { "m.in_reply_to": { "event_id": "$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og" } } }, "m.relates_to": { "rel_type": "m.replace", "event_id": "$lX9MRe9ZTFOOvnU8PRVbvr1wqGtYvNQ1rSot-iUTN5k" } } } ```
Part of https://github.com/vector-im/element-web/issues/10391 When `m.relates_to` -> `m.in_reply_to` is provided in `m.new_content` for an edited message, use the updated reply. ex. ```json { "type": "m.room.message", "content": { "body": " * foo bar", "msgtype": "m.text", "m.new_content": { "body": "foo bar", "msgtype": "m.text", "m.relates_to": { "m.in_reply_to": { "event_id": "$qkjmFBTEc0VvfVyzq1CJuh1QZi_xDIgNEFjZ4Pq34og" } } }, "m.relates_to": { "rel_type": "m.replace", "event_id": "$lX9MRe9ZTFOOvnU8PRVbvr1wqGtYvNQ1rSot-iUTN5k" } } } ```
@MadLittleMods the MSC says
Which implies you cannot attach a relation via an edit. |
@t3chguy 👍 The spec is against this usage but it can technically work. |
In in a faulty client, does synapse include the new relation in unsigned relations? Do other clients accept it too? |
@t3chguy Yes, it works in Element after matrix-org/matrix-react-sdk#6817 This is from before it became much more clear/crystalized in the MSC's (at least to me) that this was against current spec. |
I suggest opening an MSC or clarification because that pr will need reverting based on spec compliance otherwise |
@t3chguy I've created matrix-org/matrix-spec#1452 to track this. I think we should also keep this issue open to track the feature itself and how that would look like vs whether the spec actually allows for it at the moment. |
Agreed, this issue is about the feature regardless of underlying implementation |
Very often users forgot to select "Reply" when answering to message, and sends new message as new "thread". For fix this they copy-paste message text, send as new "Reply" message, and delete original message.
For simplify this correction task, will be good to have ability for attach already sent message to other message as reply, via Edit form.
The text was updated successfully, but these errors were encountered: