mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Add very rudimentary fallback reply formatting code
This commit is contained in:
parent
73ca5d21ff
commit
c0d39a5983
@ -151,8 +151,18 @@ export class BaseEventEntry extends BaseEntry {
|
|||||||
return createAnnotation(this.id, key);
|
return createAnnotation(this.id, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_formatReplyBody() {
|
||||||
|
// This is just a rough sketch for now.
|
||||||
|
// TODO case-by-case formatting
|
||||||
|
// TODO check for absense?
|
||||||
|
const bodyLines = this.content.body.split("\n");
|
||||||
|
const sender = this.sender;
|
||||||
|
bodyLines[0] = `<${sender}> ${bodyLines[0]}`
|
||||||
|
return `> ${bodyLines.join("\n> ")}\n\n`;
|
||||||
|
}
|
||||||
|
|
||||||
reply(msgtype, body) {
|
reply(msgtype, body) {
|
||||||
return createReply(this.id, msgtype, body);
|
return createReply(this.id, msgtype, this._formatReplyBody() + body);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** takes both remote event id and local txn id into account, see overriding in PendingEventEntry */
|
/** takes both remote event id and local txn id into account, see overriding in PendingEventEntry */
|
||||||
|
Loading…
Reference in New Issue
Block a user