Prevent blocking common domain names

This commit is contained in:
M66B
2020-04-19 16:57:40 +02:00
parent 6110ff0aa6
commit 242e0a0fd0
4 changed files with 32 additions and 5 deletions

View File

@@ -240,6 +240,7 @@ public class ServiceUI extends IntentService {
private void onJunk(long id) throws JSONException {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean block_sender = prefs.getBoolean("notify_block_sender", false);
List<String> whitelist = EmailProvider.getDomainNames(this);
DB db = DB.getInstance(this);
try {
@@ -256,7 +257,7 @@ public class ServiceUI extends IntentService {
EntityOperation.queue(this, message, EntityOperation.MOVE, junk.id);
if (block_sender) {
EntityRule rule = EntityRule.blockSender(this, message, junk, false);
EntityRule rule = EntityRule.blockSender(this, message, junk, false, whitelist);
rule.id = db.rule().insertRule(rule);
}