]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Remove obsolete mod/lockview.php file
[friendica.git] / src / Protocol / DFRN.php
index 54e44f5b9959dddf00029e89fb69ebb35a852266..f213af8db3068299739b33eaf56da5f5253b3b2b 100644 (file)
@@ -755,7 +755,7 @@ class DFRN
        {
                $author = $doc->createElement($element);
 
-               $contact = Contact::getDetailsByURL($contact_url, $item["uid"]);
+               $contact = Contact::getByURLForUser($contact_url, $item["uid"], false, ['url', 'name', 'addr', 'photo']);
                if (!empty($contact)) {
                        XML::addElement($doc, $author, "name", $contact["name"]);
                        XML::addElement($doc, $author, "uri", $contact["url"]);
@@ -960,7 +960,7 @@ class DFRN
                $dfrnowner = self::addEntryAuthor($doc, "dfrn:owner", $item["owner-link"], $item);
                $entry->appendChild($dfrnowner);
 
-               if (($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) {
+               if ($item['gravity'] != GRAVITY_PARENT) {
                        $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
                        $parent = Item::selectFirst(['guid', 'plink'], ['uri' => $parent_item, 'uid' => $item['uid']]);
                        $attributes = ["ref" => $parent_item, "type" => "text/html",
@@ -1194,7 +1194,7 @@ class DFRN
 
                Logger::log('dfrn_deliver: ' . $url);
 
-               $curlResult = Network::curl($url);
+               $curlResult = DI::httpRequest()->get($url);
 
                if ($curlResult->isTimeout()) {
                        return -2; // timed out
@@ -1341,9 +1341,9 @@ class DFRN
                }
 
 
-               Logger::log('dfrn_deliver: ' . "SENDING: " . print_r($postvars, true), Logger::DATA);
+               Logger::debug('dfrn_deliver', ['post' => $postvars]);
 
-               $postResult = Network::post($contact['notify'], $postvars);
+               $postResult = DI::httpRequest()->post($contact['notify'], $postvars);
 
                $xml = $postResult->getBody();
 
@@ -1440,7 +1440,7 @@ class DFRN
 
                $content_type = ($public_batch ? "application/magic-envelope+xml" : "application/json");
 
-               $postResult = Network::post($dest_url, $envelope, ["Content-Type: ".$content_type]);
+               $postResult = DI::httpRequest()->post($dest_url, $envelope, ["Content-Type: " . $content_type]);
                $xml = $postResult->getBody();
 
                $curl_stat = $postResult->getReturnCode();
@@ -1560,7 +1560,7 @@ class DFRN
                if (DBA::isResult($contact_old) && !$onlyfetch) {
                        Logger::log("Check if contact details for contact " . $contact_old["id"] . " (" . $contact_old["nick"] . ") have to be updated.", Logger::DEBUG);
 
-                       $poco = ["url" => $contact_old["url"]];
+                       $poco = ["url" => $contact_old["url"], "network" => $contact_old["network"]];
 
                        // When was the last change to name or uri?
                        $name_element = $xpath->query($element . "/atom:name", $context)->item(0);
@@ -1680,11 +1680,11 @@ class DFRN
                        $condition = ['uid' => 0, 'nurl' => Strings::normaliseLink($contact_old['url'])];
                        DBA::update('contact', $fields, $condition, true);
 
-                       Contact::updateAvatar($author['avatar'], $importer['importer_uid'], $contact['id']);
+                       Contact::updateAvatar($contact['id'], $author['avatar']);
 
                        $pcid = Contact::getIdForURL($contact_old['url']);
                        if (!empty($pcid)) {
-                               Contact::updateAvatar($author['avatar'], 0, $pcid);
+                               Contact::updateAvatar($pcid, $author['avatar']);
                        }
 
                        /*
@@ -1962,7 +1962,7 @@ class DFRN
 
                DBA::update('contact', $fields, $condition);
 
-               Contact::updateAvatar($relocate["avatar"], $importer["importer_uid"], $importer["id"], true);
+               Contact::updateAvatar($importer["id"], $relocate["avatar"], true);
 
                Logger::log('Contacts are updated.');