From e2ad589aa364aa8a4b854a2285c52849d6b999b9 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 27 Jul 2021 16:51:34 -0700 Subject: [PATCH] Go through and clean up affected files. --- src/domain/session/room/timeline/tiles/BaseMessageTile.js | 4 ++-- src/matrix/room/timeline/entries/BaseEventEntry.js | 6 +++--- .../web/ui/session/room/timeline/BaseMessageView.js | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/BaseMessageTile.js b/src/domain/session/room/timeline/tiles/BaseMessageTile.js index 9a206ad2..eef83cb6 100644 --- a/src/domain/session/room/timeline/tiles/BaseMessageTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMessageTile.js @@ -110,8 +110,8 @@ export class BaseMessageTile extends SimpleTile { this._roomVM.startReply(this); } - reply(msgtype, body) { - return this._room.sendEvent("m.room.message", this._entry.reply(msgtype, body)); + reply(msgtype, body, log = null) { + return this._room.sendEvent("m.room.message", this._entry.reply(msgtype, body), null, log); } redact(reason, log) { diff --git a/src/matrix/room/timeline/entries/BaseEventEntry.js b/src/matrix/room/timeline/entries/BaseEventEntry.js index 9782c530..41960e75 100644 --- a/src/matrix/room/timeline/entries/BaseEventEntry.js +++ b/src/matrix/room/timeline/entries/BaseEventEntry.js @@ -190,10 +190,10 @@ export class BaseEventEntry extends BaseEntry {
${body} - ` + `; } - _replyBodyFallback() { + _replyPlainFallback() { const body = this._fallbackBlurb() || this._plainBody || ""; const bodyLines = body.split("\n"); bodyLines[0] = `> <${this.sender}> ${bodyLines[0]}` @@ -202,7 +202,7 @@ export class BaseEventEntry extends BaseEntry { reply(msgtype, body) { // TODO check for absense of sender / body / msgtype / etc? - const newBody = this._replyBodyFallback() + '\n\n' + body; + const newBody = this._replyPlainFallback() + '\n\n' + body; const newFormattedBody = this._replyFormattedFallback() + htmlEscape(body); return createReply(this.id, msgtype, newBody, newFormattedBody); } diff --git a/src/platform/web/ui/session/room/timeline/BaseMessageView.js b/src/platform/web/ui/session/room/timeline/BaseMessageView.js index bb04a2b4..018b455b 100644 --- a/src/platform/web/ui/session/room/timeline/BaseMessageView.js +++ b/src/platform/web/ui/session/room/timeline/BaseMessageView.js @@ -28,8 +28,7 @@ export class BaseMessageView extends TemplateView { super(value); this._menuPopup = null; this._tagName = tagName; - // TODO An enum could be nice to make code - // easier to read at call sites. + // TODO An enum could be nice to make code easier to read at call sites. this._disabled = disabled; } @@ -56,7 +55,7 @@ export class BaseMessageView extends TemplateView { if (isContinuation && wasContinuation === false && !this._disabled) { li.removeChild(li.querySelector(".Timeline_messageAvatar")); li.removeChild(li.querySelector(".Timeline_messageSender")); - } else if (!isContinuation || this._disabled) { + } else if (!isContinuation && !this._disabled) { li.insertBefore(renderStaticAvatar(vm, 30, "Timeline_messageAvatar"), li.firstChild); li.insertBefore(tag.div({className: `Timeline_messageSender usercolor${vm.avatarColorNumber}`}, vm.displayName), li.firstChild); }