4 use Friendica\Core\System;
6 require_once 'include/probe.php';
7 require_once 'include/follow.php';
9 function repair_ostatus_content(App $a) {
12 notice( t('Permission denied.') . EOL);
13 goaway($_SESSION['return_url']);
17 $o = "<h2>".t("Resubscribing to OStatus contacts")."</h2>";
23 $counter = intval($_REQUEST['counter']);
25 $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE
26 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)",
28 dbesc(NETWORK_OSTATUS),
29 intval(CONTACT_IS_FRIEND),
30 intval(CONTACT_IS_SHARING));
33 return($o.t("Error"));
35 $total = $r[0]["total"];
37 $r = q("SELECT `url` FROM `contact` WHERE
38 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)
42 dbesc(NETWORK_OSTATUS),
43 intval(CONTACT_IS_FRIEND),
44 intval(CONTACT_IS_SHARING), $counter++);
51 $o .= "<p>".$counter."/".$total.": ".$r[0]["url"]."</p>";
53 $o .= "<p>".t("Keep this window open until done.")."</p>";
55 $result = new_contact($uid,$r[0]["url"],true);
57 $a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';