Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2018-07-11 12:25:48 +0300
committerGitHub <noreply@github.com>2018-07-11 12:25:48 +0300
commit72e06624f0bea90e77dda9062451fcb5a1eca2eb (patch)
tree653ef2e242833bf80395edb680a79e97dc188b29
parentdf3a338afb915615fb7bd20e61a88d07a507d880 (diff)
parent0d60e73e66f5bf11eb7ca82ad176380cef270f5f (diff)
Merge pull request #134 from mario/master
Add prioritization for Talk
-rw-r--r--lib/Push.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Push.php b/lib/Push.php
index 1213d7f..61b802e 100644
--- a/lib/Push.php
+++ b/lib/Push.php
@@ -190,6 +190,12 @@ class Push {
'id' => $notification->getObjectId(),
];
+ if ($isTalkNotification) {
+ $priority = 'high';
+ } else {
+ $priority = 'normal';
+ }
+
if (!openssl_public_encrypt(json_encode($data), $encryptedSubject, $device['devicepublickey'], OPENSSL_PKCS1_PADDING)) {
$this->log->error(openssl_error_string(), ['app' => 'notifications']);
throw new \InvalidArgumentException('Failed to encrypt message for device');
@@ -204,6 +210,7 @@ class Push {
'pushTokenHash' => $device['pushtokenhash'],
'subject' => $base64EncryptedSubject,
'signature' => $base64Signature,
+ 'priority' => $priority,
];
}