mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
Fixed downloading messages
This commit is contained in:
@@ -1435,10 +1435,10 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
|
||||
MessageHelper helper = new MessageHelper((MimeMessage) imessage);
|
||||
String html = helper.getHtml();
|
||||
String text = (html == null ? "" : Jsoup.parse(html).text());
|
||||
String preview = text.substring(0, Math.min(text.length(), PREVIEW_SIZE));
|
||||
String text = (html == null ? null : Jsoup.parse(html).text());
|
||||
String preview = (text == null ? null : text.substring(0, Math.min(text.length(), PREVIEW_SIZE)));
|
||||
message.write(this, html);
|
||||
db.message().setMessageContent(message.id, preview);
|
||||
db.message().setMessageContent(message.id, true, preview);
|
||||
}
|
||||
|
||||
private void doAttachment(EntityFolder folder, EntityOperation op, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws JSONException, MessagingException, IOException {
|
||||
@@ -1896,10 +1896,10 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
if (!message.content)
|
||||
if (!metered || (message.size != null && message.size < download)) {
|
||||
String html = helper.getHtml();
|
||||
String text = (html == null ? "" : Jsoup.parse(html).text());
|
||||
String preview = text.substring(0, Math.min(text.length(), PREVIEW_SIZE));
|
||||
String text = (html == null ? null : Jsoup.parse(html).text());
|
||||
String preview = (text == null ? null : text.substring(0, Math.min(text.length(), PREVIEW_SIZE)));
|
||||
message.write(context, html);
|
||||
db.message().setMessageContent(message.id, preview);
|
||||
db.message().setMessageContent(message.id, true, preview);
|
||||
Log.i(Helper.TAG, folder.name + " downloaded message id=" + message.id + " size=" + message.size);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user