X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontacts.php;h=a129a665d131d67f2e55ab020218e01d2d22e1ef;hb=a0530d1066d7268f1b1ea67bc3c254e9f9fc5ec8;hp=2539360552d20ad487e7127819f2b3c478edf010;hpb=3d4ae91569f8d8f394a39456b0cab4f3f575412e;p=friendica.git diff --git a/mod/contacts.php b/mod/contacts.php index 2539360552..a129a665d1 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -244,7 +244,7 @@ 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", @@ -348,7 +348,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']); }