]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Diaspora.php
Merge pull request #5862 from nupplaphil/rename_App_Methods
[friendica.git] / src / Protocol / Diaspora.php
index 5239255fee83eb2c2f46f1a33d0f52150aeccc77..ebdc84ce7fdd049278d5b2b082ed33ad2442f931 100644 (file)
@@ -1598,7 +1598,7 @@ class Diaspora
                        unset($parts['path']);
                        $host_url = Network::unparseURL($parts);
 
-                       return $host_url . '/object/' . $guid;
+                       return $host_url . '/objects/' . $guid;
                }
 
                return "";
@@ -1969,11 +1969,8 @@ class Diaspora
                $datarray["contact-id"] = $author_contact["cid"];
                $datarray["network"]  = $author_contact["network"];
 
-               $datarray["author-link"] = $person["url"];
-               $datarray["author-id"] = Contact::getIdForURL($person["url"], 0);
-
-               $datarray["owner-link"] = $contact["url"];
-               $datarray["owner-id"] = Contact::getIdForURL($contact["url"], 0);
+               $datarray["owner-link"] = $datarray["author-link"] = $person["url"];
+               $datarray["owner-id"] = $datarray["author-id"] = Contact::getIdForURL($person["url"], 0);
 
                $datarray["guid"] = $guid;
                $datarray["uri"] = self::getUriFromGuid($author, $guid);
@@ -3083,7 +3080,7 @@ class Diaspora
                                $content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
 
                                Network::post($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
-                               $return_code = $a->get_curl_code();
+                               $return_code = Network::getCurl()->getCode();
                        } else {
                                logger("test_mode");
                                return 200;
@@ -3092,7 +3089,7 @@ class Diaspora
 
                logger("transmit: ".$logid."-".$guid." to ".$dest_url." returns: ".$return_code);
 
-               if (!$return_code || (($return_code == 503) && (stristr($a->get_curl_headers(), "retry-after")))) {
+               if (!$return_code || (($return_code == 503) && (stristr(Network::getCurl()->getHeaders(), "retry-after")))) {
                        if (!$no_queue && !empty($contact['contact-type']) && ($contact['contact-type'] != Contact::ACCOUNT_TYPE_RELAY)) {
                                logger("queue message");
                                // queue message for redelivery
@@ -3200,7 +3197,7 @@ class Diaspora
                $author = self::myHandle($owner);
 
                $message = ["author" => $author,
-                               "guid" => System::UUID(),
+                               "guid" => System::createUUID(),
                                "parent_type" => "Post",
                                "parent_guid" => $item["guid"]];