]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
API: Accept "redirect_uris" as both array and string
[friendica.git] / src / Protocol / DFRN.php
index 52ae12f9c3f5a708f73d3370469e580c025e41cd..26d5376e4e0d40152f4fffafbdb6c9ee5ae54b34 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
  *
@@ -1014,6 +1014,10 @@ class DFRN
                $xml = $postResult->getBody();
 
                $curl_stat = $postResult->getReturnCode();
+               if (!empty($contact['gsid']) && ($postResult->isTimeout() || empty($curl_stat))) {
+                       GServer::setFailureById($contact['gsid']);
+               }
+
                if (empty($curl_stat) || empty($xml)) {
                        Logger::notice('Empty answer from ' . $contact['id'] . ' - ' . $dest_url);
                        return -9; // timed out
@@ -1035,6 +1039,10 @@ class DFRN
                        return -23;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setReachableById($contact['gsid'], Protocol::DFRN);
+               }
+
                if (!empty($res->message)) {
                        Logger::info('Transmit to ' . $dest_url . ' returned status '.$res->status.' - '.$res->message);
                }
@@ -2071,6 +2079,7 @@ class DFRN
                        // This is my contact on another system, but it's really me.
                        // Turn this into a wall post.
                        $notify = Item::isRemoteSelf($importer, $item);
+                       $item['wall'] = (bool)$notify;
 
                        $posted_id = Item::insert($item, $notify);