]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/PushSubscription.php
New parameter to create a share block for display reasons
[friendica.git] / src / Worker / PushSubscription.php
index f82f469146a5b4f988c97fe6f360891e10528973..17b47f1cbd8388dc512e1846e6868e518890e1b4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -31,7 +31,6 @@ use Friendica\Model\Contact;
 use Friendica\Model\Post;
 use Friendica\Model\Subscription as ModelSubscription;
 use Friendica\Model\User;
-use Friendica\Navigation\Notifications;
 use Friendica\Network\HTTPException\NotFoundException;
 use Minishlink\WebPush\WebPush;
 use Minishlink\WebPush\Subscription;
@@ -91,7 +90,7 @@ class PushSubscription
                }
 
                $message = DI::notificationFactory()->getMessageFromNotification($notification);
-               $title = $message['plain'] ?: '';
+               $title = $message['plain'] ?? '';
 
                $push = Subscription::create([
                        'contentEncoding' => 'aesgcm',
@@ -102,7 +101,6 @@ class PushSubscription
                        ],
                ]);
 
-               // @todo Only used for logging?
                $payload = [
                        'access_token'      => $application_token['access_token'],
                        'preferred_locale'  => $user['language'],
@@ -117,7 +115,7 @@ class PushSubscription
 
                $auth = [
                        'VAPID' => [
-                               'subject'    => DI::baseUrl()->getHostname(),
+                               'subject'    => DI::baseUrl()->getHost(),
                                'publicKey'  => ModelSubscription::getPublicVapidKey(),
                                'privateKey' => ModelSubscription::getPrivateVapidKey(),
                        ],