X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fostatus_subscribe.php;h=70a36559e4483edf0ed4ca71e11619331f0fb870;hb=a5e91175243a41c77a56e73efc3672f20a7e6d23;hp=c950e9700e4a5fc74b1738480f8827d8f50caff7;hpb=aa9ceabdd9eeec82393e4d5f09aad09c181af33d;p=friendica.git diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php index c950e9700e..70a36559e4 100644 --- a/mod/ostatus_subscribe.php +++ b/mod/ostatus_subscribe.php @@ -1,17 +1,21 @@ ".t("Subsribing to OStatus contacts").""; + $o = "

".t("Subscribing to OStatus contacts")."

"; $uid = local_user(); @@ -19,35 +23,38 @@ function ostatus_subscribe_content(&$a) { $counter = intval($_REQUEST['counter']); - if (get_pconfig($uid, "ostatus", "legacy_friends") == "") { + if (PConfig::get($uid, "ostatus", "legacy_friends") == "") { - if ($_REQUEST["url"] == "") + if ($_REQUEST["url"] == "") { return $o.t("No contact provided."); + } - $contact = probe_url($_REQUEST["url"]); + $contact = Probe::uri($_REQUEST["url"]); - if (!$contact) + if (!$contact) { return $o.t("Couldn't fetch information for contact."); + } $api = $contact["baseurl"]."/api/"; // Fetching friends $data = z_fetch_url($api."statuses/friends.json?screen_name=".$contact["nick"]); - if (!$data["success"]) + if (!$data["success"]) { return $o.t("Couldn't fetch friends for contact."); + } - set_pconfig($uid, "ostatus", "legacy_friends", $data["body"]); + PConfig::set($uid, "ostatus", "legacy_friends", $data["body"]); } - $friends = json_decode(get_pconfig($uid, "ostatus", "legacy_friends")); + $friends = json_decode(PConfig::get($uid, "ostatus", "legacy_friends")); $total = sizeof($friends); if ($counter >= $total) { - $a->page['htmlhead'] = ''; - del_pconfig($uid, "ostatus", "legacy_friends"); - del_pconfig($uid, "ostatus", "legacy_contact"); + $a->page['htmlhead'] = ''; + PConfig::delete($uid, "ostatus", "legacy_friends"); + PConfig::delete($uid, "ostatus", "legacy_contact"); $o .= t("Done"); return $o; } @@ -58,21 +65,23 @@ function ostatus_subscribe_content(&$a) { $o .= "

".$counter."/".$total.": ".$url; - $data = probe_url($url); + $data = Probe::uri($url); if ($data["network"] == NETWORK_OSTATUS) { - $result = new_contact($uid,$url,true); - if ($result["success"]) + $result = new_contact($uid, $url, true, NETWORK_OSTATUS); + if ($result["success"]) { $o .= " - ".t("success"); - else + } else { $o .= " - ".t("failed"); - } else + } + } else { $o .= " - ".t("ignored"); + } $o .= "

"; $o .= "

".t("Keep this window open until done.")."

"; - $a->page['htmlhead'] = ''; + $a->page['htmlhead'] = ''; return $o; }