diff --git a/src/matrix/room/timeline/entries/BaseEventEntry.js b/src/matrix/room/timeline/entries/BaseEventEntry.js index b6850540..ecbacb6e 100644 --- a/src/matrix/room/timeline/entries/BaseEventEntry.js +++ b/src/matrix/room/timeline/entries/BaseEventEntry.js @@ -18,7 +18,7 @@ import {BaseEntry} from "./BaseEntry.js"; import {REDACTION_TYPE} from "../../common.js"; import {createAnnotation, ANNOTATION_RELATION_TYPE, getRelationFromContent} from "../relations.js"; import {PendingAnnotation} from "../PendingAnnotation.js"; -import {reply} from "./reply.js" +import {createReplyContent} from "./reply.js" /** Deals mainly with local echo for relations and redactions, * so it is shared between PendingEventEntry and EventEntry */ @@ -157,7 +157,7 @@ export class BaseEventEntry extends BaseEntry { } reply(msgtype, body) { - return reply(this, msgtype, body); + return createReplyContent(this, msgtype, body); } /** takes both remote event id and local txn id into account, see overriding in PendingEventEntry */ diff --git a/src/matrix/room/timeline/entries/reply.js b/src/matrix/room/timeline/entries/reply.js index 0120f332..2e180c11 100644 --- a/src/matrix/room/timeline/entries/reply.js +++ b/src/matrix/room/timeline/entries/reply.js @@ -36,7 +36,7 @@ function fallbackPrefix(msgtype) { return msgtype === "m.emote" ? "* " : ""; } -function createReply(targetId, msgtype, body, formattedBody) { +function _createReplyContent(targetId, msgtype, body, formattedBody) { return { msgtype, body, @@ -50,7 +50,7 @@ function createReply(targetId, msgtype, body, formattedBody) { }; } -export function reply(entry, msgtype, body) { +export function createReplyContent(entry, msgtype, body) { // TODO check for absense of sender / body / msgtype / etc? const nonTextual = fallbackForNonTextualMessage(entry.content.msgtype); const prefix = fallbackPrefix(entry.content.msgtype); @@ -70,5 +70,5 @@ export function reply(entry, msgtype, body) { const newBody = plainFallback + '\n\n' + body; const newFormattedBody = formattedFallback + htmlEscape(body); - return createReply(entry.id, msgtype, newBody, newFormattedBody); + return _createReplyContent(entry.id, msgtype, newBody, newFormattedBody); }