X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fostatus_subscribe.php;h=a9f7c3a909111ed329904b990807db31b1355bda;hb=b42167f0ac5b76fc42e6da1ced2b001862417f5e;hp=6cca0bf67942537b75020a43008623e678cb734b;hpb=8ec424325375aa923c7d2d78ac8ddcc352f09cff;p=friendica.git diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php index 6cca0bf679..a9f7c3a909 100644 --- a/mod/ostatus_subscribe.php +++ b/mod/ostatus_subscribe.php @@ -3,9 +3,9 @@ require_once('include/Scrape.php'); require_once('include/follow.php'); -function ostatus_subscribe_content(&$a) { +function ostatus_subscribe_content(App $a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); goaway($_SESSION['return_url']); // NOTREACHED @@ -21,21 +21,24 @@ function ostatus_subscribe_content(&$a) { if (get_pconfig($uid, "ostatus", "legacy_friends") == "") { - if ($_REQUEST["url"] == "") + if ($_REQUEST["url"] == "") { return $o.t("No contact provided."); + } $contact = probe_url($_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"]); } @@ -45,7 +48,7 @@ function ostatus_subscribe_content(&$a) { $total = sizeof($friends); if ($counter >= $total) { - $a->page['htmlhead'] = ''; + $a->page['htmlhead'] = ''; del_pconfig($uid, "ostatus", "legacy_friends"); del_pconfig($uid, "ostatus", "legacy_contact"); $o .= t("Done"); @@ -61,18 +64,20 @@ function ostatus_subscribe_content(&$a) { $data = probe_url($url); if ($data["network"] == NETWORK_OSTATUS) { $result = new_contact($uid,$url,true); - if ($result["success"]) + 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; }