Improved silent messages support
This commit is contained in:
parent
594bbe4496
commit
1a93895d4c
@ -197,8 +197,7 @@ angular.module('myApp.services')
|
|||||||
maxSeenID &&
|
maxSeenID &&
|
||||||
dialog.top_message > maxSeenID &&
|
dialog.top_message > maxSeenID &&
|
||||||
message.pFlags.unread &&
|
message.pFlags.unread &&
|
||||||
!message.pFlags.out &&
|
!message.pFlags.out
|
||||||
!message.pFlags.silent
|
|
||||||
) {
|
) {
|
||||||
var notifyPeer = message.flags & 16 ? message.from_id : peerID
|
var notifyPeer = message.flags & 16 ? message.from_id : peerID
|
||||||
NotificationsManager.getPeerMuted(notifyPeer).then(function (muted) {
|
NotificationsManager.getPeerMuted(notifyPeer).then(function (muted) {
|
||||||
@ -2784,6 +2783,7 @@ angular.module('myApp.services')
|
|||||||
notification.message = notificationMessage
|
notification.message = notificationMessage
|
||||||
notification.key = 'msg' + message.mid
|
notification.key = 'msg' + message.mid
|
||||||
notification.tag = peerString
|
notification.tag = peerString
|
||||||
|
notification.silent = message.pFlags.silent || false
|
||||||
|
|
||||||
if (notificationPhoto.location && !notificationPhoto.location.empty) {
|
if (notificationPhoto.location && !notificationPhoto.location.empty) {
|
||||||
MtpApiFileManager.downloadSmallFile(notificationPhoto.location, notificationPhoto.size).then(function (blob) {
|
MtpApiFileManager.downloadSmallFile(notificationPhoto.location, notificationPhoto.size).then(function (blob) {
|
||||||
@ -2954,8 +2954,7 @@ angular.module('myApp.services')
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (inboxUnread &&
|
if (inboxUnread &&
|
||||||
($rootScope.selectedPeerID != peerID || $rootScope.idle.isIDLE) &&
|
($rootScope.selectedPeerID != peerID || $rootScope.idle.isIDLE)) {
|
||||||
!message.pFlags.silent) {
|
|
||||||
var notifyPeer = message.flags & 16 ? message.from_id : peerID
|
var notifyPeer = message.flags & 16 ? message.from_id : peerID
|
||||||
var notifyPeerToHandle = notificationsToHandle[notifyPeer]
|
var notifyPeerToHandle = notificationsToHandle[notifyPeer]
|
||||||
if (notifyPeerToHandle === undefined) {
|
if (notifyPeerToHandle === undefined) {
|
||||||
|
@ -3869,7 +3869,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
notification = new Notification(data.title, {
|
notification = new Notification(data.title, {
|
||||||
icon: data.image || '',
|
icon: data.image || '',
|
||||||
body: data.message || '',
|
body: data.message || '',
|
||||||
tag: data.tag || ''
|
tag: data.tag || '',
|
||||||
|
silent: data.silent || false
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
notificationsUiSupport = false
|
notificationsUiSupport = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user