mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 16:06:15 +00:00
We notify user every 2 minutes but also is unread messages are different
This commit is contained in:
parent
a0babdc613
commit
4f016d89ab
@ -17,6 +17,7 @@ var lastMsgDate = 0;
|
||||
var unreadCountCurrentConv = 0;
|
||||
var unreadCountAllConv = 0;
|
||||
var unreadCountNotifStep = 12;
|
||||
var lastUnreadCountAllConv = 0;
|
||||
var originalTitle = document.title;
|
||||
|
||||
$.urlParam = function(name){
|
||||
@ -125,10 +126,14 @@ var checkNewMessages = function() {
|
||||
}
|
||||
|
||||
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");
|
||||
unreadCountNotifStep = 12;
|
||||
lastUnreadCountAllConv = unreadCountAllConv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user