Set draft preview text

This commit is contained in:
M66B 2018-12-23 08:04:36 +00:00
parent 78431857ce
commit e87525e9c3
1 changed files with 7 additions and 1 deletions

View File

@ -1233,13 +1233,16 @@ public class FragmentCompose extends FragmentEx {
}
}
result.draft.content = true;
result.draft.received = new Date().getTime();
result.draft.setContactInfo(context);
result.draft.id = db.message().insertMessage(result.draft);
result.draft.write(context, body == null ? "" : body);
String text = (body == null ? null : Jsoup.parse(body).text());
String preview = (text == null ? null : text.substring(0, Math.min(text.length(), 250)));
db.message().setMessageContent(result.draft.id, true, preview);
if ("new".equals(action)) {
ArrayList<Uri> uris = args.getParcelableArrayList("attachments");
if (uris != null)
@ -1628,6 +1631,9 @@ public class FragmentCompose extends FragmentEx {
draft.replying == null ? draft.forwarding : draft.replying, false);
draft.write(context, body);
String text = (body == null ? null : Jsoup.parse(body).text());
String preview = (text == null ? null : text.substring(0, Math.min(text.length(), 250)));
db.message().setMessageContent(draft.id, true, preview);
// Execute action
if (action == R.id.action_delete) {