]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/PushSubscriber.php
Remove "fcontact" from suggestions
[friendica.git] / src / Model / PushSubscriber.php
index 2a7be3c35a1c6eb86f8264d6015f81e0f3aea4d4..f6839307249c67542e605e71389e26279828fc2a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -25,6 +25,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Network;
 
 class PushSubscriber
 {
@@ -170,5 +171,13 @@ class PushSubscriber
                $fields = ['push' => 0, 'next_try' => DBA::NULL_DATETIME, 'last_update' => $last_update];
                DBA::update('push_subscriber', $fields, ['id' => $id]);
                Logger::log('Subscriber ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as vital', Logger::DEBUG);
+
+               $parts = parse_url($subscriber['callback_url']);
+               unset($parts['path']);
+               $server_url = Network::unparseURL($parts);
+               $gsid = GServer::getID($server_url, true);
+               if (!empty($gsid)) {
+                       GServer::setProtocol($gsid, Post\DeliveryData::OSTATUS);
+               }
        }
 }