From bc0ba8a0d7e45f53ae7a29b84e8a271cb18f1ee9 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 20 Apr 2016 07:26:18 +0200 Subject: [PATCH] Added description --- include/socgraph.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/socgraph.php b/include/socgraph.php index f7dd1ad93b..d13dc1cd63 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -1377,12 +1377,19 @@ function clean_contact_url($url) { return $new_url; } +/** + * @brief Replace alternate OStatus user format with the primary one + * + * @param arr $contact contact array (called by reference) + */ function fix_alternate_contact_address(&$contact) { if (($contact["network"] == NETWORK_OSTATUS) AND poco_alternate_ostatus_url($contact["url"])) { $data = probe_url($contact["url"]); - if (!in_array($contact["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) { + if ($contact["network"] == NETWORK_OSTATUS) { + logger("Fix primary url from ".$contact["url"]." to ".$data["url"], LOGGER_DEBUG); $contact["url"] = $data["url"]; $contact["addr"] = $data["addr"]; + $contact["alias"] = $data["alias"]; $contact["server_url"] = $data["baseurl"]; } } -- 2.39.5