-
Notifications
You must be signed in to change notification settings - Fork 388
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
MSC1695 Message Edits #1695
Closed
Half-Shot
wants to merge
13
commits into
matrix-org:master
from
Half-Shot:hs/1695-message-edits-proposal
Closed
MSC1695 Message Edits #1695
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9ab25b9
Placehold 1695
Half-Shot cecb7da
Add proposal body
Half-Shot cac4d88
Grammar
Half-Shot 9aa0618
Wrap lines
Half-Shot 3c5a447
Clarifications
Half-Shot a0e6241
s/supersedes/replaces
Half-Shot 986a3c2
Rejig text
Half-Shot 1d5aeba
Redact note
Half-Shot df90d12
Add reason for travis
Half-Shot 66a80df
Edit history.
Half-Shot 0dc3242
capitalise SHOULD/MUST/COULD
Half-Shot 1346552
Clients must refuse to display edits by other people
Half-Shot 1317d2b
More strict rules about representation
Half-Shot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Proposal | ||
======== | ||
|
||
I propose for message edits to follow a similar format to replies, using `m.relates_to`. | ||
The content of the edited message should be inside `m.replaces.new_content` which can | ||
be accessed if the client is edit-aware. If the client is not aware, it can use `content.body` | ||
and `content.formatted_body` to render an approximation of the edit. The fallback should be | ||
in the format given below. | ||
|
||
Clients should always favour fetching the source from `m.replaces.event_id` where possible, | ||
rather than using the fallback as the fallback can be faked. Furthermore, clients should refuse | ||
to display with an appropriate message when the sender of the source event and the edit event differ. | ||
|
||
It should be noted that this allows any event to be replaced by an entirely different set of content. | ||
The client should make a best effort attempt to describe the relationship between the two events for | ||
both the fallback and representation. | ||
|
||
If the edit event's content is invalid, it is acceptable to display/keep the old event in place with a warning. | ||
|
||
User should be warned that editing an an | ||
|
||
Example | ||
------- | ||
|
||
Original message: | ||
```javascript | ||
{ | ||
"content": { | ||
"body": "This is an example message I want to edit.", | ||
"msgtype": "m.text" | ||
}, | ||
"event_id": "$1539340060524DGxMc:half-shot.uk", | ||
"sender": "@Half-Shot:half-shot.uk", | ||
"type": "m.room.message", | ||
"room_id": "!IPcexxPYNJKmTvRfoV:half-shot.uk" | ||
} | ||
``` | ||
|
||
New edited message: | ||
```javascript | ||
{ | ||
"content": { | ||
"body": "Edited: ~~This is an example message I want to edit~~ This is the edited message", | ||
"format": "org.matrix.custom.html", | ||
"formatted_body": "Edited: <del>This is an example message I want to edit</del> This is the edited message", | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"m.relates_to": { | ||
"m.replaces": { | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"event_id": "$1539340060524DGxMc:half-shot.uk", | ||
"new_content": { | ||
"body": "This is the edited message.", | ||
"msgtype": "m.text" | ||
} | ||
} | ||
}, | ||
"msgtype": "m.text" | ||
}, | ||
"event_id": "$1539340066525PiiWI:half-shot.uk", | ||
"sender": "@Half-Shot:half-shot.uk", | ||
"type": "m.room.message", | ||
"room_id": "!IPcexxPYNJKmTvRfoV:half-shot.uk" | ||
} | ||
``` | ||
|
||
Problems | ||
-------- | ||
|
||
Clients will also render the original event without the edit if the client isn't aware of | ||
the edited event since event aggregations aren't a thing yet. This is considered an | ||
acceptable risk for this proposal and aggregations are considered an extension to | ||
message edits for Matrix. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably worth spelling out here too that the intention here is more to standardise metadata than provide a good UX in clients pre-aggregations. |
||
|
||
It should be noted that many bridges and bots already show edits in the form of a | ||
fallback already, so this event only strives to add some specced metadata to allow | ||
clients to render them clearly.In the future, this proposal could be extended to | ||
use aggregations to show a list of edits made to a message. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an an?! :D