mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-23 06:13:09 +00:00
We notify user every 2 minutes but also is unread messages are different
This commit is contained in:
+7
-2
@@ -17,6 +17,7 @@ var lastMsgDate = 0;
|
|||||||
var unreadCountCurrentConv = 0;
|
var unreadCountCurrentConv = 0;
|
||||||
var unreadCountAllConv = 0;
|
var unreadCountAllConv = 0;
|
||||||
var unreadCountNotifStep = 12;
|
var unreadCountNotifStep = 12;
|
||||||
|
var lastUnreadCountAllConv = 0;
|
||||||
var originalTitle = document.title;
|
var originalTitle = document.title;
|
||||||
|
|
||||||
$.urlParam = function(name){
|
$.urlParam = function(name){
|
||||||
@@ -125,10 +126,14 @@ var checkNewMessages = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (unreadCountAllConv > 0) {
|
if (unreadCountAllConv > 0) {
|
||||||
// We notify user every two minutes for all messages
|
/*
|
||||||
if (unreadCountNotifStep == 0) {
|
* We notify user every two minutes for all messages
|
||||||
|
* or if unreadCount changes
|
||||||
|
*/
|
||||||
|
if (unreadCountNotifStep == 0 || lastUnreadCountAllConv != unreadCountAllConv) {
|
||||||
desktopNotify(unreadCountAllConv + " unread message(s) for all conversations");
|
desktopNotify(unreadCountAllConv + " unread message(s) for all conversations");
|
||||||
unreadCountNotifStep = 12;
|
unreadCountNotifStep = 12;
|
||||||
|
lastUnreadCountAllConv = unreadCountAllConv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user