From 60ca8996d3a11cf1a0f1d9e617370d793baeeba5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 30 Mar 2022 16:53:15 +0100 Subject: [PATCH] Fix issue with replying outside a thread to a thread root (#8195) --- src/utils/Reply.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/utils/Reply.ts b/src/utils/Reply.ts index 43144a34a1..1873ca38b3 100644 --- a/src/utils/Reply.ts +++ b/src/utils/Reply.ts @@ -147,30 +147,13 @@ export function getNestedReplyText( export function makeReplyMixIn(ev?: MatrixEvent): RecursivePartial { if (!ev) return {}; - const mixin: RecursivePartial = { + return { 'm.relates_to': { 'm.in_reply_to': { 'event_id': ev.getId(), }, }, }; - - /** - * If the event replied is part of a thread - * Add the `m.thread` relation so that clients - * that know how to handle that relation will - * be able to render them more accurately - */ - if (ev.isThreadRelation || ev.isThreadRoot) { - mixin['m.relates_to'] = { - ...mixin['m.relates_to'], - is_falling_back: false, - rel_type: THREAD_RELATION_TYPE.name, - event_id: ev.threadRootId, - }; - } - - return mixin; } export function shouldDisplayReply(event: MatrixEvent): boolean { @@ -210,8 +193,7 @@ export function addReplyToMessageContent( Object.assign(content, replyContent); if (opts.includeLegacyFallback) { - // Part of Replies fallback support - prepend the text we're sending - // with the text we're replying to + // Part of Replies fallback support - prepend the text we're sending with the text we're replying to const nestedReply = getNestedReplyText(replyToEvent, opts.permalinkCreator); if (nestedReply) { if (content.formatted_body) {