This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 827
Show updated relation reply from edited message - v2 #6817
Merged
MadLittleMods
merged 4 commits into
develop
from
madlittlemods/10391-show-relations-in-new-edit-content-v2
Sep 17, 2021
Merged
Show updated relation reply from edited message - v2 #6817
MadLittleMods
merged 4 commits into
develop
from
madlittlemods/10391-show-relations-in-new-edit-content-v2
Sep 17, 2021
Conversation
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
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" } } } ```
Fixes: ``` Attempted to get a component (views.elements.Flair) before a skin has been loaded. This is probably because either: a) Your app has not called sdk.loadSkin(), or b) A component has called getComponent at the root level 23 | if (!name) throw new Error(`Invalid component name: ${name}`); 24 | if (this.components === null) { > 25 | throw new Error( | ^ 26 | `Attempted to get a component (${name}) before a skin has been loaded.`+ 27 | " This is probably because either:"+ 28 | " a) Your app has not called sdk.loadSkin(), or"+ at Skinner.getComponent (src/Skinner.js:25:19) at Object.getComponent (src/index.js:29:20) at src/utils/replaceableComponent.ts:41:22 at Object.<anonymous> (src/components/views/elements/Flair.js:65:94) at Object.<anonymous> (src/components/views/messages/SenderProfile.tsx:21:1) at Object.<anonymous> (src/components/views/rooms/ReplyTile.tsx:23:1) at Object.<anonymous> (src/components/views/elements/ReplyThread.tsx:34:1) at Object.<anonymous> (test/components/views/elements/ReplyThread-test.js:3:1) ```
013cdb8
to
9f6a5b8
Compare
MadLittleMods
commented
Sep 16, 2021
ed7ce02
to
7d88e4d
Compare
dbkr
approved these changes
Sep 17, 2021
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.
Thanks for the tests!
Thanks for the review @dbkr 🐃 |
MadLittleMods
commented
Dec 1, 2022
Comment on lines
+92
to
+97
// We're prefer ev.getContent() over ev.getWireContent() to make sure | ||
// we grab the latest edit with potentially new relations. But we also | ||
// can't just rely on ev.getContent() by itself because historically we | ||
// still show the reply from the original message even though the edit | ||
// event does not include the relation reply. | ||
const mRelatesTo = ev.getContent()['m.relates_to'] || ev.getWireContent()['m.relates_to']; |
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.
Tracing down where this code has gone since this was merged, the codebase has morphed a bit and this code has moved to:
matrix-js-sdk
->src/models/event.ts#L544-L552
via Extend IEventRelation to define m.in_reply_to matrix-js-sdk#2108matrix-react-sdk
side: Implement reply chain fallback for threads backwards compatibility #7565
ReplyThread
was renamed toReplyChain
on thematrix-react-sdk
side
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.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
T-Enhancement
New features, changes in functionality, performance boosts, user-facing improvements
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.
Follow-up to #6809
Show updated relation reply from edited message
When
m.relates_to
->m.in_reply_to
is provided inm.new_content
for an edited message, use the updated reply.
ex.
Dev notes
Here's what your changelog entry will look like:
✨ Features
Preview: https://6142e26957e9c0d62cdb9763--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.