Improved silent messages support

This commit is contained in:
Igor Zhukov 2017-01-30 17:22:13 +03:00
parent 594bbe4496
commit 1a93895d4c
2 changed files with 5 additions and 5 deletions

View File

@ -197,8 +197,7 @@ angular.module('myApp.services')
maxSeenID &&
dialog.top_message > maxSeenID &&
message.pFlags.unread &&
!message.pFlags.out &&
!message.pFlags.silent
!message.pFlags.out
) {
var notifyPeer = message.flags & 16 ? message.from_id : peerID
NotificationsManager.getPeerMuted(notifyPeer).then(function (muted) {
@ -2784,6 +2783,7 @@ angular.module('myApp.services')
notification.message = notificationMessage
notification.key = 'msg' + message.mid
notification.tag = peerString
notification.silent = message.pFlags.silent || false
if (notificationPhoto.location && !notificationPhoto.location.empty) {
MtpApiFileManager.downloadSmallFile(notificationPhoto.location, notificationPhoto.size).then(function (blob) {
@ -2954,8 +2954,7 @@ angular.module('myApp.services')
}
if (inboxUnread &&
($rootScope.selectedPeerID != peerID || $rootScope.idle.isIDLE) &&
!message.pFlags.silent) {
($rootScope.selectedPeerID != peerID || $rootScope.idle.isIDLE)) {
var notifyPeer = message.flags & 16 ? message.from_id : peerID
var notifyPeerToHandle = notificationsToHandle[notifyPeer]
if (notifyPeerToHandle === undefined) {

View File

@ -3869,7 +3869,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
notification = new Notification(data.title, {
icon: data.image || '',
body: data.message || '',
tag: data.tag || ''
tag: data.tag || '',
silent: data.silent || false
})
} catch (e) {
notificationsUiSupport = false