From 6a556d73adb414428f60439abce7808b2b9c8269 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 22 Dec 2021 15:16:33 +0530 Subject: [PATCH] Always include reply content --- src/matrix/room/timeline/entries/reply.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/matrix/room/timeline/entries/reply.js b/src/matrix/room/timeline/entries/reply.js index 7b05b272..fcc6f56f 100644 --- a/src/matrix/room/timeline/entries/reply.js +++ b/src/matrix/room/timeline/entries/reply.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {getRelatedEventId, THREADING_RELATION_TYPE} from "../relations.js"; +import {THREADING_RELATION_TYPE} from "../relations.js"; function htmlEscape(string) { return string.replace(/&/g, "&").replace(//g, ">"); @@ -60,11 +60,6 @@ function _createReplyContent(targetId, msgtype, body, formattedBody, threadId) { } export function createReplyContent(entry, msgtype, body) { - // don't use entry.isReply here since we pretend that threads are replies - if (!entry.relation["m.in_reply_to"] && entry.isThread) { - return createThreadContent(entry, msgtype, body); - } - // TODO check for absense of sender / body / msgtype / etc? const nonTextual = fallbackForNonTextualMessage(entry.content.msgtype); const prefix = fallbackPrefix(entry.content.msgtype); const sender = entry.sender; @@ -85,14 +80,3 @@ export function createReplyContent(entry, msgtype, body) { const newFormattedBody = formattedFallback + htmlEscape(body); return _createReplyContent(entry.id, msgtype, newBody, newFormattedBody, entry.threadEventId); } - -function createThreadContent(entry, msgtype, body) { - return { - msgtype, - body, - "m.relates_to": { - "rel_type": THREADING_RELATION_TYPE, - "event_id": getRelatedEventId(entry) - } - }; -}