Rename create
rename create function to createFromProbe and update calls.
This commit is contained in:
parent
c81e83c500
commit
5358f5742e
|
@ -242,7 +242,7 @@ function _contact_update($contact_id)
|
||||||
$uid = $contact["uid"];
|
$uid = $contact["uid"];
|
||||||
|
|
||||||
if ($r[0]["network"] == NETWORK_OSTATUS) {
|
if ($r[0]["network"] == NETWORK_OSTATUS) {
|
||||||
$result = Contact::create($uid, $contact["url"], false, $contact["network"]);
|
$result = Contact::createFromProbe($uid, $contact["url"], false, $contact["network"]);
|
||||||
|
|
||||||
if ($result['success']) {
|
if ($result['success']) {
|
||||||
q("UPDATE `contact` SET `subhub` = 1 WHERE `id` = %d", intval($contact_id));
|
q("UPDATE `contact` SET `subhub` = 1 WHERE `id` = %d", intval($contact_id));
|
||||||
|
@ -274,7 +274,7 @@ function _contact_update_profile($contact_id)
|
||||||
$update = array();
|
$update = array();
|
||||||
|
|
||||||
if ($data["network"] == NETWORK_OSTATUS) {
|
if ($data["network"] == NETWORK_OSTATUS) {
|
||||||
$result = Contact::create($uid, $data["url"], false);
|
$result = Contact::createFromProbe($uid, $data["url"], false);
|
||||||
|
|
||||||
if ($result['success']) {
|
if ($result['success']) {
|
||||||
$update["subhub"] = true;
|
$update["subhub"] = true;
|
||||||
|
|
|
@ -30,7 +30,7 @@ function follow_post(App $a) {
|
||||||
// This is just a precaution if maybe this page is called somewhere directly via POST
|
// This is just a precaution if maybe this page is called somewhere directly via POST
|
||||||
$_SESSION["fastlane"] = $url;
|
$_SESSION["fastlane"] = $url;
|
||||||
|
|
||||||
$result = Contact::create($uid, $url, true);
|
$result = Contact::createFromProbe($uid, $url, true);
|
||||||
|
|
||||||
if ($result['success'] == false) {
|
if ($result['success'] == false) {
|
||||||
if ($result['message']) {
|
if ($result['message']) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ function ostatus_subscribe_content(App $a) {
|
||||||
|
|
||||||
$data = Probe::uri($url);
|
$data = Probe::uri($url);
|
||||||
if ($data["network"] == NETWORK_OSTATUS) {
|
if ($data["network"] == NETWORK_OSTATUS) {
|
||||||
$result = Contact::create($uid, $url, true, NETWORK_OSTATUS);
|
$result = Contact::createFromProbe($uid, $url, true, NETWORK_OSTATUS);
|
||||||
if ($result["success"]) {
|
if ($result["success"]) {
|
||||||
$o .= " - ".t("success");
|
$o .= " - ".t("success");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -52,7 +52,7 @@ function repair_ostatus_content(App $a) {
|
||||||
|
|
||||||
$o .= "<p>".t("Keep this window open until done.")."</p>";
|
$o .= "<p>".t("Keep this window open until done.")."</p>";
|
||||||
|
|
||||||
$result = Contact::create($uid,$r[0]["url"],true);
|
$result = Contact::createFromProbe($uid,$r[0]["url"],true);
|
||||||
|
|
||||||
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';
|
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ function salmon_post(App $a) {
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBM::is_result($r)) {
|
||||||
logger('mod-salmon: Author unknown to us.');
|
logger('mod-salmon: Author unknown to us.');
|
||||||
if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) {
|
if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) {
|
||||||
$result = Contact::create($importer['uid'], $author_link);
|
$result = Contact::createFromProbe($importer['uid'], $author_link);
|
||||||
if($result['success']) {
|
if($result['success']) {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
|
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
|
||||||
AND `uid` = %d LIMIT 1",
|
AND `uid` = %d LIMIT 1",
|
||||||
|
|
|
@ -1089,7 +1089,7 @@ class Contact extends BaseObject
|
||||||
* @param string $network
|
* @param string $network
|
||||||
* @return boolean|string
|
* @return boolean|string
|
||||||
*/
|
*/
|
||||||
public static function create($uid, $url, $interactive = false, $network = '')
|
public static function createFromProbe($uid, $url, $interactive = false, $network = '')
|
||||||
{
|
{
|
||||||
$result = array('cid' => -1, 'success' => false, 'message' => '');
|
$result = array('cid' => -1, 'success' => false, 'message' => '');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue