Added attachments to templates

This commit is contained in:
M66B
2024-06-16 10:29:15 +02:00
parent 18666c4b5e
commit f399facb00
10 changed files with 222 additions and 95 deletions

View File

@@ -1159,10 +1159,12 @@ public class EntityRule {
reply.id = db.message().insertMessage(reply);
String body;
EntityAnswer.Data answerData = null;
if (resend)
body = Helper.readText(message.getFile(context));
else {
body = answer.getHtml(context, message.from);
answerData = answer.getData(context, message.from);
body = answerData.getHtml();
if (original_text) {
Document msg = JsoupEx.parse(body);
@@ -1219,6 +1221,9 @@ public class EntityRule {
db.attachment().setDownloaded(attachment.id, target.length());
}
if (answerData != null)
answerData.insertAttachments(context, reply.id);
EntityOperation.queue(context, reply, EntityOperation.SEND);
// Batch send operations, wait until after commit