Added curPeerId check for notifications on mobile

Closes #270
This commit is contained in:
Igor Zhukov 2014-08-05 15:43:36 +01:00
parent f40627faae
commit 0ddf417726
2 changed files with 8 additions and 1 deletions

View File

@ -701,6 +701,7 @@ angular.module('myApp.controllers', [])
return false;
}
$rootScope.selectedPeerID = peerID;
$scope.curDialog.peerID = peerID;
$scope.curDialog.inputPeer = AppPeersManager.getInputPeer(newPeer);
$scope.historyFilter.mediaType = false;

View File

@ -2021,7 +2021,9 @@ angular.module('myApp.services', [])
$rootScope.$broadcast('dialogs_update', dialog);
if ($rootScope.idle.isIDLE && !message.out && message.unread) {
if ((Config.Navigator.mobile && $rootScope.selectedPeerID != peerID || $rootScope.idle.isIDLE) &&
!message.out &&
message.unread) {
NotificationsManager.getPeerMuted(peerID).then(function (muted) {
if (!message.unread || muted) {
return;
@ -3217,6 +3219,10 @@ angular.module('myApp.services', [])
if (!started) {
started = true;
$($window).on('blur focus keydown mousedown touchstart', onEvent);
setTimeout(function () {
onEvent({type: 'blur'});
}, 0);
}
}