Rename reply function in reply.js

This commit is contained in:
Danila Fedorin 2021-08-06 10:16:20 -07:00
parent 21b067eaff
commit 5a0bc55e54
2 changed files with 5 additions and 5 deletions

View file

@ -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 */

View file

@ -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);
}