Refactoring

This commit is contained in:
M66B
2019-09-27 19:37:34 +02:00
parent 1ec286fe8b
commit e54a6ca90c
3 changed files with 32 additions and 33 deletions

View File

@@ -352,10 +352,11 @@ public class EntityRule {
if (identity == null)
throw new IllegalArgumentException("Rule identity not found");
String body = EntityAnswer.getAnswerText(context, aid, message.from);
if (body == null)
EntityAnswer answer = db.answer().getAnswer(aid);
if (answer == null)
throw new IllegalArgumentException("Rule answer not found");
EntityMessage reply = new EntityMessage();
reply.account = message.account;
reply.folder = db.folder().getOutbox().id;
@@ -376,6 +377,8 @@ public class EntityRule {
reply.avatar = (lookupUri == null ? null : lookupUri.toString());
reply.id = db.message().insertMessage(reply);
String body = answer.getText(message.from);
Helper.writeText(reply.getFile(context), body);
db.message().setMessageContent(reply.id,
true,