|
|
@ -1466,6 +1466,30 @@ class Core {
|
|
|
|
|
|
|
|
|
|
|
|
if (message.received > account.created)
|
|
|
|
if (message.received > account.created)
|
|
|
|
updateContactInfo(context, folder, message);
|
|
|
|
updateContactInfo(context, folder, message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
|
|
|
long maxSize = prefs.getInt("download", 0);
|
|
|
|
|
|
|
|
if (maxSize == 0)
|
|
|
|
|
|
|
|
maxSize = MessageHelper.SMALL_MESSAGE_SIZE;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
maxSize = Math.min(maxSize, MessageHelper.SMALL_MESSAGE_SIZE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Download small messages inline
|
|
|
|
|
|
|
|
if (message.size != null && message.size < maxSize) {
|
|
|
|
|
|
|
|
String body = parts.getHtml(context);
|
|
|
|
|
|
|
|
Helper.writeText(message.getFile(context), body);
|
|
|
|
|
|
|
|
db.message().setMessageContent(message.id,
|
|
|
|
|
|
|
|
true,
|
|
|
|
|
|
|
|
parts.isPlainOnly(),
|
|
|
|
|
|
|
|
HtmlHelper.getPreview(body),
|
|
|
|
|
|
|
|
parts.getWarnings(message.warning));
|
|
|
|
|
|
|
|
Log.i(folder.name + " inline downloaded message id=" + message.id +
|
|
|
|
|
|
|
|
" size=" + message.size + "/" + (body == null ? null : body.length()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!TextUtils.isEmpty(body))
|
|
|
|
|
|
|
|
fixAttachments(context, message.id, body);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (process) {
|
|
|
|
if (process) {
|
|
|
|
EntityIdentity identity = matchIdentity(context, folder, message);
|
|
|
|
EntityIdentity identity = matchIdentity(context, folder, message);
|
|
|
@ -1716,7 +1740,6 @@ class Core {
|
|
|
|
maxSize = Long.MAX_VALUE;
|
|
|
|
maxSize = Long.MAX_VALUE;
|
|
|
|
|
|
|
|
|
|
|
|
List<EntityAttachment> attachments = db.attachment().getAttachments(message.id);
|
|
|
|
List<EntityAttachment> attachments = db.attachment().getAttachments(message.id);
|
|
|
|
MessageHelper helper = new MessageHelper(imessage);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean fetch = false;
|
|
|
|
boolean fetch = false;
|
|
|
|
if (!message.content)
|
|
|
|
if (!message.content)
|
|
|
@ -1747,10 +1770,12 @@ class Core {
|
|
|
|
//fp.add(IMAPFolder.FetchProfileItem.INTERNALDATE);
|
|
|
|
//fp.add(IMAPFolder.FetchProfileItem.INTERNALDATE);
|
|
|
|
//ifolder.fetch(new Message[]{imessage}, fp);
|
|
|
|
//ifolder.fetch(new Message[]{imessage}, fp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MessageHelper helper = new MessageHelper(imessage);
|
|
|
|
MessageHelper.MessageParts parts = helper.getMessageParts();
|
|
|
|
MessageHelper.MessageParts parts = helper.getMessageParts();
|
|
|
|
|
|
|
|
|
|
|
|
if (!message.content) {
|
|
|
|
if (!message.content) {
|
|
|
|
if (state.getNetworkState().isUnmetered() || (message.size != null && message.size < maxSize)) {
|
|
|
|
if (state.getNetworkState().isUnmetered() ||
|
|
|
|
|
|
|
|
(message.size != null && message.size < maxSize)) {
|
|
|
|
String body = parts.getHtml(context);
|
|
|
|
String body = parts.getHtml(context);
|
|
|
|
Helper.writeText(message.getFile(context), body);
|
|
|
|
Helper.writeText(message.getFile(context), body);
|
|
|
|
db.message().setMessageContent(message.id,
|
|
|
|
db.message().setMessageContent(message.id,
|
|
|
|