]> git.mxchange.org Git - friendica.git/blobdiff - mod/contacts.php
proc_run was replaced
[friendica.git] / mod / contacts.php
index 2539360552d20ad487e7127819f2b3c478edf010..216d2451eaaba34941b0ff95a87185490a627e58 100644 (file)
@@ -2,6 +2,7 @@
 
 use Friendica\App;
 use Friendica\Core\System;
+use Friendica\Core\Worker;
 use Friendica\Network\Probe;
 
 require_once 'include/Contact.php';
@@ -244,14 +245,14 @@ function _contact_update($contact_id) {
                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) {
@@ -348,7 +349,16 @@ function _contact_archive($contact_id, $orig_record) {
 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']);
 }
 
@@ -862,7 +872,7 @@ function contacts_tab($a, $contact_id, $active_tab) {
                        'url' => "contacts/".$contact_id,
                        'sel' => (($active_tab == 2)?'active':''),
                        'title' => t('Profile Details'),
-                       'id' => 'status-tab',
+                       'id' => 'profile-tab',
                        'accesskey' => 'o',
                )
        );