]> git.mxchange.org Git - friendica.git/commitdiff
Compatibility with pleroma added
authorMichael <heluecht@pirati.ca>
Mon, 21 Aug 2017 20:21:04 +0000 (20:21 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 21 Aug 2017 20:21:04 +0000 (20:21 +0000)
include/feed.php
include/ostatus.php
src/Network/Probe.php

index cfef6d4ad03deb12b562840dfec395a827601eb9..1545ff34ce34843037edba79fc131d5cac2e2987 100644 (file)
@@ -108,6 +108,14 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
                        if ($value != "") {
                                $author["author-about"] = $value;
                        }
+                       $avatar = $xpath->evaluate("atom:author/atom:link[@rel='avatar']")->item(0)->attributes;
+                       if (is_object($avatar)) {
+                               foreach ($avatar AS $attributes) {
+                                       if ($attributes->name == "href") {
+                                               $author["author-avatar"] = $attributes->textContent;
+                                       }
+                               }
+                       }
                }
 
                $author["edited"] = $author["created"] = $xpath->query('/atom:feed/atom:updated/text()')->item(0)->nodeValue;
index 6bec3987bb794ea4dfc3fb67682b749ed8e4d664..3e27bc5d5792a2b1000baa409a0bd32106d94e7d 100644 (file)
@@ -101,7 +101,7 @@ class ostatus {
                                        $width = $attributes->textContent;
                                }
                        }
-                       if (($width > 0) && ($href != "")) {
+                       if ($href != "") {
                                $avatarlist[$width] = $href;
                        }
                }
index 5a70247afcea6427a68e21440ec4d8a51f5ea030..17b44eadb3cacb3586984d8b0112f6b4f099fba6 100644 (file)
@@ -1201,6 +1201,7 @@ class Probe {
                if (!$feed_data) {
                        return false;
                }
+
                if ($feed_data["header"]["author-name"] != "") {
                        $data["name"] = $feed_data["header"]["author-name"];
                }
@@ -1224,6 +1225,12 @@ class Probe {
                if ($feed_data["header"]["author-link"] != "") {
                        $data["url"] = $feed_data["header"]["author-link"];
                }
+
+               if (($data['poll'] == $data['url']) && ($data["alias"] != '')) {
+                       $data['url'] = $data["alias"];
+                       $data["alias"] = '';
+               }
+
                /// @todo Fetch location and "about" from the feed as well
                return $data;
        }