mirror of https://github.com/vector-im/riot-web
Merge pull request #2977 from matrix-org/jryans/encrypted-reactions
Use `getRelation` helperpull/21833/head
commit
0e369bd12e
|
@ -63,6 +63,11 @@ export default class ReplyThread extends React.Component {
|
||||||
static getParentEventId(ev) {
|
static getParentEventId(ev) {
|
||||||
if (!ev || ev.isRedacted()) return;
|
if (!ev || ev.isRedacted()) return;
|
||||||
|
|
||||||
|
// XXX: For newer relations (annotations, replacements, etc.), we now
|
||||||
|
// have a `getRelation` helper on the event, and you might assume it
|
||||||
|
// could be used here for replies as well... However, the helper
|
||||||
|
// currently assumes the relation has a `rel_type`, which older replies
|
||||||
|
// do not, so this block is left as-is for now.
|
||||||
const mRelatesTo = ev.getWireContent()['m.relates_to'];
|
const mRelatesTo = ev.getWireContent()['m.relates_to'];
|
||||||
if (mRelatesTo && mRelatesTo['m.in_reply_to']) {
|
if (mRelatesTo && mRelatesTo['m.in_reply_to']) {
|
||||||
const mInReplyTo = mRelatesTo['m.in_reply_to'];
|
const mInReplyTo = mRelatesTo['m.in_reply_to'];
|
||||||
|
|
|
@ -82,7 +82,7 @@ export default class ReactionDimension extends React.PureComponent {
|
||||||
if (mxEvent.isRedacted()) {
|
if (mxEvent.isRedacted()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return mxEvent.getContent()["m.relates_to"].key === option;
|
return mxEvent.getRelation().key === option;
|
||||||
});
|
});
|
||||||
if (!reactionForOption) {
|
if (!reactionForOption) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -101,7 +101,7 @@ export default class ReactionsRow extends React.PureComponent {
|
||||||
if (mxEvent.isRedacted()) {
|
if (mxEvent.isRedacted()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return mxEvent.getContent()["m.relates_to"].key === content;
|
return mxEvent.getRelation().key === content;
|
||||||
});
|
});
|
||||||
return <ReactionsRowButton
|
return <ReactionsRowButton
|
||||||
key={content}
|
key={content}
|
||||||
|
|
Loading…
Reference in New Issue