mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +00:00
Set draft preview text
This commit is contained in:
parent
78431857ce
commit
e87525e9c3
1 changed files with 7 additions and 1 deletions
|
@ -1233,13 +1233,16 @@ public class FragmentCompose extends FragmentEx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result.draft.content = true;
|
|
||||||
result.draft.received = new Date().getTime();
|
result.draft.received = new Date().getTime();
|
||||||
result.draft.setContactInfo(context);
|
result.draft.setContactInfo(context);
|
||||||
|
|
||||||
result.draft.id = db.message().insertMessage(result.draft);
|
result.draft.id = db.message().insertMessage(result.draft);
|
||||||
result.draft.write(context, body == null ? "" : body);
|
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)) {
|
if ("new".equals(action)) {
|
||||||
ArrayList<Uri> uris = args.getParcelableArrayList("attachments");
|
ArrayList<Uri> uris = args.getParcelableArrayList("attachments");
|
||||||
if (uris != null)
|
if (uris != null)
|
||||||
|
@ -1628,6 +1631,9 @@ public class FragmentCompose extends FragmentEx {
|
||||||
draft.replying == null ? draft.forwarding : draft.replying, false);
|
draft.replying == null ? draft.forwarding : draft.replying, false);
|
||||||
|
|
||||||
draft.write(context, body);
|
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
|
// Execute action
|
||||||
if (action == R.id.action_delete) {
|
if (action == R.id.action_delete) {
|
||||||
|
|
Loading…
Reference in a new issue