Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Preserve reply fallback on edit #3192

Merged
merged 3 commits into from
Jul 8, 2019

Conversation

bwindels
Copy link
Contributor

@bwindels bwindels commented Jul 8, 2019

Fixes element-hq/element-web#10220

Example of an edited reply with these changes:

{
  "content": {
    "body": "> <@bruno4:matrix.org> doo\n\n * parrrrrr",
    "format": "org.matrix.custom.html",
    "formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!RbjQlmGUZlYnyhGpoZ:matrix.org/$1562590340825854VjKGO:matrix.org?via=matrix.org\">In reply to</a> <a href=\"https://matrix.to/#/@bruno4:matrix.org\">@bruno4:matrix.org</a><br>doo</blockquote></mx-reply> * parrrrrr",
    "m.new_content": {
      "body": "> <@bruno4:matrix.org> doo\n\nparrrrrr",
      "format": "org.matrix.custom.html",
      "formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!RbjQlmGUZlYnyhGpoZ:matrix.org/$1562590340825854VjKGO:matrix.org?via=matrix.org\">In reply to</a> <a href=\"https://matrix.to/#/@bruno4:matrix.org\">@bruno4:matrix.org</a><br>doo</blockquote></mx-reply>parrrrrr",
      "msgtype": "m.text"
    },
    "m.relates_to": {
      "event_id": "$1562591229829192bgNMu:matrix.org",
      "rel_type": "m.replace"
    },
    "msgtype": "m.text"
  },
  "event_id": "$1562591236829226iyhEm:matrix.org",
  "origin_server_ts": 1562591236665,
  "room_id": "!RbjQlmGUZlYnyhGpoZ:matrix.org",
  "sender": "@bruno4:matrix.org",
  "type": "m.room.message",
  "unsigned": {
    "age": 1702880
  },
  "user_id": "@bruno4:matrix.org",
  "age": 1702880
}

@bwindels bwindels requested a review from a team July 8, 2019 13:42
@jryans jryans requested review from jryans and removed request for a team July 8, 2019 14:41
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good overall! 😁

src/editor/serialize.js Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reply fallback gets stripped upon edit
2 participants