Update update and new functions to updateFromProbe and create. Update calls to renamed functions.
$uid = $contact["uid"];
if ($r[0]["network"] == NETWORK_OSTATUS) {
- $result = Contact::new($uid, $contact["url"], false, $contact["network"]);
+ $result = Contact::create($uid, $contact["url"], false, $contact["network"]);
if ($result['success']) {
q("UPDATE `contact` SET `subhub` = 1 WHERE `id` = %d", intval($contact_id));
$update = array();
if ($data["network"] == NETWORK_OSTATUS) {
- $result = Contact::new($uid, $data["url"], false);
+ $result = Contact::create($uid, $data["url"], false);
if ($result['success']) {
$update["subhub"] = true;
// This is just a precaution if maybe this page is called somewhere directly via POST
$_SESSION["fastlane"] = $url;
- $result = Contact::new($uid, $url, true);
+ $result = Contact::create($uid, $url, true);
if ($result['success'] == false) {
if ($result['message']) {
$data = Probe::uri($url);
if ($data["network"] == NETWORK_OSTATUS) {
- $result = Contact::new($uid, $url, true, NETWORK_OSTATUS);
+ $result = Contact::create($uid, $url, true, NETWORK_OSTATUS);
if ($result["success"]) {
$o .= " - ".t("success");
} else {
$o .= "<p>".t("Keep this window open until done.")."</p>";
- $result = Contact::new($uid,$r[0]["url"],true);
+ $result = Contact::create($uid,$r[0]["url"],true);
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';
if (! DBM::is_result($r)) {
logger('mod-salmon: Author unknown to us.');
if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) {
- $result = Contact::new($importer['uid'], $author_link);
+ $result = Contact::create($importer['uid'], $author_link);
if($result['success']) {
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
AND `uid` = %d LIMIT 1",
* @param integer $id contact id
* @return boolean
*/
- public static function update($id)
+ public static function updateFromProbe($id)
{
/*
Warning: Never ever fetch the public key via Probe::uri and write it into the contacts.
* @param string $network
* @return boolean|string
*/
- public static function add($uid, $url, $interactive = false, $network = '')
+ public static function create($uid, $url, $interactive = false, $network = '')
{
$result = array('cid' => -1, 'success' => false, 'message' => '');
return;
}
- if (!Contact::update($contact["id"])) {
+ if (!Contact::updateFromProbe($contact["id"])) {
Contact::markForArchival($contact);
logger('Contact is marked dead');