Poll reply fixes and other misc improvements

This commit is contained in:
10G Meow 2022-11-30 08:25:32 +00:00 committed by N Pex
parent a1e9e3894e
commit 78fdb94362
15 changed files with 42 additions and 39 deletions

View file

@ -163,9 +163,11 @@ class Util {
event_id: replyToEvent.getId()
}
}
let senderContent = replyToEvent.getContent()
const senderContentBody = Object.getOwnPropertyDescriptor(senderContent,'body') ? senderContent.body : Object.values(senderContent)[0].question.body
// Prefix the content with reply info (seems to be a legacy thing)
const prefix = replyToEvent.getContent().body.split('\n').map((item, index) => {
const prefix = senderContentBody.split('\n').map((item, index) => {
return "> " + (index == 0 ? ("<" + replyToEvent.getSender() + "> ") : "") + item;
}).join('\n');
content.body = prefix + "\n\n" + content.body;