mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-14 13:03:13 +02:00
Auto ignore type specific
This commit is contained in:
@@ -787,12 +787,16 @@ public interface DaoMessage {
|
||||
" AND account IN (" +
|
||||
" SELECT id FROM account" +
|
||||
" WHERE :folder IS NOT NULL" +
|
||||
" OR :type IS NOT NULL" +
|
||||
" OR id = :account" +
|
||||
" OR (:account IS NULL AND NOT account.notify))" +
|
||||
" OR (:account IS NULL AND NOT notify))" +
|
||||
" AND folder IN (" +
|
||||
" SELECT id FROM folder" +
|
||||
" WHERE (:folder IS NULL AND folder.unified) OR id = :folder)")
|
||||
int ignoreAll(Long account, Long folder);
|
||||
" WHERE notify" +
|
||||
" AND (id = :folder" +
|
||||
" OR (type = :type AND type <> '" + EntityFolder.OUTBOX + "')" +
|
||||
" OR (:folder IS NULL AND :type IS NULL AND unified)))")
|
||||
int ignoreAll(Long account, Long folder, String type);
|
||||
|
||||
@Query("UPDATE message SET ui_found = 1 WHERE id = :id AND NOT (ui_found IS 1)")
|
||||
int setMessageFound(long id);
|
||||
|
||||
@@ -4078,16 +4078,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
if (notify_clear) {
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("folder", folder);
|
||||
args.putString("type", type);
|
||||
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
Long folder = args.getLong("folder");
|
||||
String type = args.getString("type");
|
||||
|
||||
if (folder < 0)
|
||||
folder = null;
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
db.message().ignoreAll(null, folder);
|
||||
db.message().ignoreAll(null, folder, type);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -191,9 +191,9 @@ public class ServiceUI extends IntentService {
|
||||
DB db = DB.getInstance(this);
|
||||
int cleared;
|
||||
if (group < 0)
|
||||
cleared = db.message().ignoreAll(null, -group);
|
||||
cleared = db.message().ignoreAll(null, -group, null);
|
||||
else
|
||||
cleared = db.message().ignoreAll(group == 0 ? null : group, null);
|
||||
cleared = db.message().ignoreAll(group == 0 ? null : group, null, null);
|
||||
EntityLog.log(this, EntityLog.Type.Notification,
|
||||
"Notify clear group=" + group + " cleared=" + cleared);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user