mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Go through and clean up affected files.
This commit is contained in:
parent
fb54ab68a3
commit
e2ad589aa3
@ -110,8 +110,8 @@ export class BaseMessageTile extends SimpleTile {
|
|||||||
this._roomVM.startReply(this);
|
this._roomVM.startReply(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
reply(msgtype, body) {
|
reply(msgtype, body, log = null) {
|
||||||
return this._room.sendEvent("m.room.message", this._entry.reply(msgtype, body));
|
return this._room.sendEvent("m.room.message", this._entry.reply(msgtype, body), null, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
redact(reason, log) {
|
redact(reason, log) {
|
||||||
|
@ -190,10 +190,10 @@ export class BaseEventEntry extends BaseEntry {
|
|||||||
<br />
|
<br />
|
||||||
${body}
|
${body}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</mx-reply>`
|
</mx-reply>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
_replyBodyFallback() {
|
_replyPlainFallback() {
|
||||||
const body = this._fallbackBlurb() || this._plainBody || "";
|
const body = this._fallbackBlurb() || this._plainBody || "";
|
||||||
const bodyLines = body.split("\n");
|
const bodyLines = body.split("\n");
|
||||||
bodyLines[0] = `> <${this.sender}> ${bodyLines[0]}`
|
bodyLines[0] = `> <${this.sender}> ${bodyLines[0]}`
|
||||||
@ -202,7 +202,7 @@ export class BaseEventEntry extends BaseEntry {
|
|||||||
|
|
||||||
reply(msgtype, body) {
|
reply(msgtype, body) {
|
||||||
// TODO check for absense of sender / body / msgtype / etc?
|
// 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);
|
const newFormattedBody = this._replyFormattedFallback() + htmlEscape(body);
|
||||||
return createReply(this.id, msgtype, newBody, newFormattedBody);
|
return createReply(this.id, msgtype, newBody, newFormattedBody);
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,7 @@ export class BaseMessageView extends TemplateView {
|
|||||||
super(value);
|
super(value);
|
||||||
this._menuPopup = null;
|
this._menuPopup = null;
|
||||||
this._tagName = tagName;
|
this._tagName = tagName;
|
||||||
// TODO An enum could be nice to make code
|
// TODO An enum could be nice to make code easier to read at call sites.
|
||||||
// easier to read at call sites.
|
|
||||||
this._disabled = disabled;
|
this._disabled = disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ export class BaseMessageView extends TemplateView {
|
|||||||
if (isContinuation && wasContinuation === false && !this._disabled) {
|
if (isContinuation && wasContinuation === false && !this._disabled) {
|
||||||
li.removeChild(li.querySelector(".Timeline_messageAvatar"));
|
li.removeChild(li.querySelector(".Timeline_messageAvatar"));
|
||||||
li.removeChild(li.querySelector(".Timeline_messageSender"));
|
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(renderStaticAvatar(vm, 30, "Timeline_messageAvatar"), li.firstChild);
|
||||||
li.insertBefore(tag.div({className: `Timeline_messageSender usercolor${vm.avatarColorNumber}`}, vm.displayName), li.firstChild);
|
li.insertBefore(tag.div({className: `Timeline_messageSender usercolor${vm.avatarColorNumber}`}, vm.displayName), li.firstChild);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user