mirror of
https://github.com/friendica/friendica
synced 2025-04-30 21:44:22 +02:00
Fetch more comtact data from probing, remove duplicated contacts
This commit is contained in:
parent
a06de3127f
commit
8cbdc7939e
4 changed files with 88 additions and 17 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue