* Returns the notification hash. This hash is used in {@link #getStatus()} to
* determine whether the notifications changed and need to be reloaded.
*/
-public getNotificationHash() {
+function getNotificationHash() {
return $("#sone #notification-area #notification-hash").text();
}
/**
+ * Sets the notification hash.
+ *
+ * @param notificationHash
+ * The new notification hash
+ */
+function setNotificationHash(notificationHash) {
+ $("#sone #notification-area #notification-hash").text(notificationHash);
+}
+
+/**
* Retrieves element IDs from notification elements.
*
* @param notification
if (!notLoggedIn) {
showOfflineMarker(!online);
}
+ if (data.notificationHash != getNotificationHash()) {
+ console.log("Old hash: ", getNotificationHash(), ", new hash: ", data.notificationHash);
+ setNotificationHash(data.notificationHash);
+ }
/* search for removed notifications. */
$("#sone #notification-area .notification").each(function() {
notificationId = $(this).attr("id");