Collect enabled email addresses only

This commit is contained in:
M66B 2019-09-12 22:10:56 +02:00
parent 5fc374d1ac
commit 801143198b
1 changed files with 12 additions and 1 deletions

View File

@ -1776,12 +1776,23 @@ class Core {
private static void updateContactInfo(Context context, final EntityFolder folder, final EntityMessage message) { private static void updateContactInfo(Context context, final EntityFolder folder, final EntityMessage message) {
final DB db = DB.getInstance(context); final DB db = DB.getInstance(context);
if (EntityFolder.ARCHIVE.equals(folder.type) || if (EntityFolder.DRAFTS.equals(folder.type) ||
EntityFolder.ARCHIVE.equals(folder.type) ||
EntityFolder.TRASH.equals(folder.type) || EntityFolder.TRASH.equals(folder.type) ||
EntityFolder.JUNK.equals(folder.type)) EntityFolder.JUNK.equals(folder.type))
return; return;
final int type = (folder.isOutgoing() ? EntityContact.TYPE_TO : EntityContact.TYPE_FROM); final int type = (folder.isOutgoing() ? EntityContact.TYPE_TO : EntityContact.TYPE_FROM);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean suggest_sent = prefs.getBoolean("suggest_sent", false);
boolean suggest_received = prefs.getBoolean("suggest_received", false);
if (type == EntityContact.TYPE_TO && !suggest_sent)
return;
if (type == EntityContact.TYPE_FROM && !suggest_received)
return;
Address[] recipients = (type == EntityContact.TYPE_TO Address[] recipients = (type == EntityContact.TYPE_TO
? message.to ? message.to
: (message.reply != null ? message.reply : message.from)); : (message.reply != null ? message.reply : message.from));