diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php
index 95e4a8db38..84ebd0b205 100755
--- a/module/common/view/footer.html.php
+++ b/module/common/view/footer.html.php
@@ -16,11 +16,12 @@ needPing = false;
$(function()
{
var windowBlur = false;
- if(window.Notification)
+ if(window.Notification && Notification.permission == 'granted')
{
window.onblur = function(){windowBlur = true;}
window.onfocus = function(){windowBlur = false;}
}
+
setInterval(function()
{
$.get(createLink('message', 'ajaxGetMessage', "windowBlur=" + (windowBlur ? '1' : '0')), function(data)
diff --git a/module/mr/model.php b/module/mr/model.php
index 712740bb74..b60a9a3566 100644
--- a/module/mr/model.php
+++ b/module/mr/model.php
@@ -1392,6 +1392,7 @@ class mrModel extends model
->where('t1.AType')->eq('mr')
->andWhere('t1.BType')->eq($objectType)
->andWhere('t1.BID')->eq($objectID)
+ ->andWhere('t2.id')->ne(0)
->fetchPairs();
}