|
|
@@ -138,16 +138,18 @@ public class Notification {
|
|
|
|
|
|
/**
|
|
|
* If the notification is an update.
|
|
|
+ *
|
|
|
+ * @param keepFlag
|
|
|
+ * Set to false to remove the flag from the option map
|
|
|
*/
|
|
|
- protected boolean isUpdate () {
|
|
|
-
|
|
|
- if (!options.getDict().has("updatedAt"))
|
|
|
- return false;
|
|
|
+ protected boolean isUpdate (boolean keepFlag) {
|
|
|
+ boolean updated = options.getDict().optBoolean("updated", false);
|
|
|
|
|
|
- long now = new Date().getTime();
|
|
|
- long updatedAt = options.getDict().optLong("updatedAt", now);
|
|
|
+ if (!keepFlag) {
|
|
|
+ options.getDict().remove("updated");
|
|
|
+ }
|
|
|
|
|
|
- return (now - updatedAt) < 1000;
|
|
|
+ return updated;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -268,7 +270,7 @@ public class Notification {
|
|
|
}
|
|
|
|
|
|
json.remove("firstAt");
|
|
|
- json.remove("updatedAt");
|
|
|
+ json.remove("updated");
|
|
|
json.remove("soundUri");
|
|
|
json.remove("iconUri");
|
|
|
|