|
|
|
@ -5351,25 +5351,41 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
args.putString("type", type);
|
|
|
|
|
args.putBoolean("notify_clear", notify_clear);
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
@Override
|
|
|
|
|
protected Void onExecute(Context context, Bundle args) {
|
|
|
|
|
long folder = args.getLong("folder");
|
|
|
|
|
String type = args.getString("type");
|
|
|
|
|
boolean notify_clear = args.getBoolean("notify_clear");
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
try {
|
|
|
|
|
db.beginTransaction();
|
|
|
|
|
|
|
|
|
|
if (folder < 0) {
|
|
|
|
|
List<EntityAccount> accounts = db.account().getSynchronizingAccounts(null);
|
|
|
|
|
if (accounts != null)
|
|
|
|
|
for (EntityAccount account : accounts)
|
|
|
|
|
for (EntityAccount account : accounts) {
|
|
|
|
|
if (notify_clear)
|
|
|
|
|
db.message().ignoreAll(account.id, null, type);
|
|
|
|
|
} else
|
|
|
|
|
db.folder().setFolderLastView(account.id, null, type, new Date().getTime());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (notify_clear)
|
|
|
|
|
db.message().ignoreAll(null, folder, type);
|
|
|
|
|
db.folder().setFolderLastView(null, folder, type, new Date().getTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
db.setTransactionSuccessful();
|
|
|
|
|
} finally {
|
|
|
|
|
db.endTransaction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -5381,7 +5397,6 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
}.execute(this, args, "messages:ignore");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onPause() {
|
|
|
|
|