use Friendica\App;
use Friendica\Core\System;
+use Friendica\Core\Worker;
use Friendica\Network\Probe;
require_once 'include/Contact.php';
return;
if ($r[0]["network"] == NETWORK_OSTATUS) {
- $result = new_contact($uid, $r[0]["url"], false);
+ $result = new_contact($uid, $r[0]["url"], false, $r[0]["network"]);
if ($result['success'])
$r = q("UPDATE `contact` SET `subhub` = 1 WHERE `id` = %d",
intval($contact_id));
} else
// pull feed and consume it, which should subscribe to the hub.
- proc_run(PRIORITY_HIGH, "include/onepoll.php", $contact_id, "force");
+ Worker::add(PRIORITY_HIGH, "onepoll", $contact_id, "force");
}
function _contact_update_profile($contact_id) {
function _contact_drop($contact_id, $orig_record) {
$a = get_app();
- terminate_friendship($a->user,$a->contact,$orig_record);
+ $r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
+ WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
+ intval($a->user['uid'])
+ );
+ if (!dbm::is_result($r)) {
+ return;
+ }
+
+ $self = ""; // Unused parameter
+ terminate_friendship($r[0], $self, $orig_record);
contact_remove($orig_record['id']);
}
'url' => "contacts/".$contact_id,
'sel' => (($active_tab == 2)?'active':''),
'title' => t('Profile Details'),
- 'id' => 'status-tab',
+ 'id' => 'profile-tab',
'accesskey' => 'o',
)
);