Refactoring

This commit is contained in:
M66B
2022-09-19 15:35:26 +02:00
parent 48e6125ebc
commit e241522132
2 changed files with 21 additions and 16 deletions

View File

@@ -373,6 +373,26 @@ public class EntityMessage implements Serializable {
!EntityMessage.SMIME_SIGNENCRYPT.equals(encrypt));
}
boolean isNotJunk(Context context) {
DB db = DB.getInstance(context);
boolean notJunk = false;
for (Address sender : from) {
String email = ((InternetAddress) sender).getAddress();
if (TextUtils.isEmpty(email))
continue;
EntityContact contact = db.contact().getContact(account, EntityContact.TYPE_NO_JUNK, email);
if (contact != null) {
contact.times_contacted++;
contact.last_contacted = new Date().getTime();
db.contact().updateContact(contact);
notJunk = true;
}
}
return notJunk;
}
String[] checkFromDomain(Context context) {
return MessageHelper.equalRootDomain(context, from, smtp_from);
}