Add very rudimentary fallback reply formatting code
This commit is contained in:
parent
73ca5d21ff
commit
c0d39a5983
1 changed files with 11 additions and 1 deletions
|
@ -151,8 +151,18 @@ export class BaseEventEntry extends BaseEntry {
|
|||
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) {
|
||||
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 */
|
||||
|
|
Reference in a new issue