Added option to remove notifications on viewing message list

This commit is contained in:
M66B
2019-10-27 16:46:57 +01:00
parent 033a60b311
commit 0515c1b2cf
6 changed files with 56 additions and 5 deletions

View File

@@ -2444,6 +2444,32 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
prefs.registerOnSharedPreferenceChangeListener(this);
onSharedPreferenceChanged(prefs, "pro");
if (viewType == AdapterMessage.ViewType.UNIFIED || viewType == AdapterMessage.ViewType.FOLDER) {
boolean notify_clear = prefs.getBoolean("notify_clear", false);
if (notify_clear) {
Bundle args = new Bundle();
args.putLong("folder", folder);
new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) {
Long folder = args.getLong("folder");
if (folder < 0)
folder = null;
DB db = DB.getInstance(context);
db.message().ignoreAll(null, folder);
return null;
}
@Override
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(this, args, "messages:ignore");
}
}
}
@Override