1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Always set message lookup URI

This commit is contained in:
M66B 2019-03-14 16:02:27 +00:00
parent 38fcadab9b
commit b4e2894a7a
3 changed files with 14 additions and 3 deletions

View file

@ -1167,7 +1167,6 @@ class Core {
message.inreplyto = helper.getInReplyTo();
message.deliveredto = helper.getDeliveredTo();
message.thread = helper.getThreadId(uid);
message.sender = MessageHelper.getSortKey(helper.getFrom());
message.from = helper.getFrom();
message.to = helper.getTo();
message.cc = helper.getCc();
@ -1191,6 +1190,7 @@ class Core {
message.ui_ignored = seen;
message.ui_browsed = browsed;
message.sender = MessageHelper.getSortKey(message.from);
Uri lookupUri = ContactInfo.getLookupUri(context, message.from);
message.avatar = (lookupUri == null ? null : lookupUri.toString());

View file

@ -20,6 +20,7 @@ package eu.faircode.email;
*/
import android.content.Context;
import android.net.Uri;
import org.json.JSONException;
import org.json.JSONObject;
@ -217,8 +218,12 @@ public class EntityRule {
if (cc)
reply.cc = message.cc;
reply.subject = context.getString(R.string.title_subject_reply, message.subject == null ? "" : message.subject);
reply.sender = MessageHelper.getSortKey(reply.from);
reply.received = new Date().getTime();
reply.sender = MessageHelper.getSortKey(reply.from);
Uri lookupUri = ContactInfo.getLookupUri(context, reply.from);
reply.avatar = (lookupUri == null ? null : lookupUri.toString());
reply.id = db.message().insertMessage(reply);
Helper.writeText(reply.getFile(context), body);
db.message().setMessageContent(reply.id, true, HtmlHelper.getPreview(body), null);

View file

@ -1747,6 +1747,8 @@ public class FragmentCompose extends FragmentBase {
}
draft.sender = MessageHelper.getSortKey(draft.from);
Uri lookupUri = ContactInfo.getLookupUri(context, draft.from);
draft.avatar = (lookupUri == null ? null : lookupUri.toString());
draft.received = new Date().getTime();
@ -2093,13 +2095,17 @@ public class FragmentCompose extends FragmentBase {
// Update draft
draft.identity = ident;
draft.extra = extra;
draft.sender = MessageHelper.getSortKey(afrom);
draft.from = afrom;
draft.to = ato;
draft.cc = acc;
draft.bcc = abcc;
draft.subject = subject;
draft.received = new Date().getTime();
draft.sender = MessageHelper.getSortKey(draft.from);
Uri lookupUri = ContactInfo.getLookupUri(context, draft.from);
draft.avatar = (lookupUri == null ? null : lookupUri.toString());
db.message().updateMessage(draft);
Helper.writeText(draft.getFile(context), body);
db.message().setMessageContent(draft.id, true, HtmlHelper.getPreview(body), null);