]> git.mxchange.org Git - friendica.git/blobdiff - src/Network/Probe.php
Fetch more comtact data from probing, remove duplicated contacts
[friendica.git] / src / Network / Probe.php
index 0094609b26fab1c9fa9b14d5f2b02c7f9345026e..c38c43c0902261bfaff771787765454e954a5621 100644 (file)
@@ -45,8 +45,8 @@ class Probe
         */
        private static function rearrangeData($data)
        {
-               $fields = ["name", "nick", "guid", "url", "addr", "alias", "photo",
-                               "account-type", "community", "keywords", "location", "about",
+               $fields = ["name", "nick", "guid", "url", "addr", "alias", "photo", "account-type",
+                               "community", "keywords", "location", "about", "gender", "hide",
                                "batch", "notify", "poll", "request", "confirm", "poco",
                                "following", "followers", "inbox", "outbox", "sharedinbox",
                                "priority", "network", "pubkey", "baseurl"];
@@ -351,6 +351,7 @@ class Probe
                        if (!empty($ap_profile) && empty($network) && (defaults($data, 'network', '') != Protocol::DFRN)) {
                                $data = $ap_profile;
                        } elseif (!empty($ap_profile)) {
+                               $ap_profile['batch'] = '';
                                $data = array_merge($ap_profile, $data);
                        }
                } else {
@@ -739,7 +740,7 @@ class Probe
                }
 
                if (!empty($json["tags"])) {
-                       $keywords = implode(" ", $json["tags"]);
+                       $keywords = implode(", ", $json["tags"]);
                        if ($keywords != "") {
                                $data["keywords"] = $keywords;
                        }
@@ -754,6 +755,10 @@ class Probe
                        $data["about"] = $json["about"];
                }
 
+               if (!empty($json["gender"])) {
+                       $data["gender"] = $json["gender"];
+               }
+
                if (!empty($json["key"])) {
                        $data["pubkey"] = $json["key"];
                }
@@ -778,6 +783,12 @@ class Probe
                        $data["poll"] = $json["dfrn-poll"];
                }
 
+               if (isset($json["hide"])) {
+                       $data["hide"] = (bool)$json["hide"];
+               } else {
+                       $data["hide"] = false;
+               }
+
                return $data;
        }