if (!DBA::isResult($contact)) {
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => 0]);
}
+
+ // Don't display contacts that are about to be deleted
+ if ($contact['network'] == Protocol::PHANTOM) {
+ $contact = false;
+ }
}
if (DBA::isResult($contact)) {
function contacts_batch_actions(App $a)
{
- $contacts_id = $_POST['contact_batch'];
- if (!is_array($contacts_id)) {
+ if (empty($_POST['contact_batch']) || !is_array($_POST['contact_batch'])) {
return;
}
+ $contacts_id = $_POST['contact_batch'];
+
$orig_records = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND `uid` = %d AND `self` = 0",
implode(",", $contacts_id),
intval(local_user())
return;
}
- Contact::terminateFriendship($r[0], $orig_record);
+ Contact::terminateFriendship($r[0], $orig_record, true);
Contact::remove($orig_record['id']);
}
/// @todo Only show the following link with DFRN when the remote version supports it
$follow = '';
$follow_text = '';
- if (in_array($contact['network'], [Protocol::DIASPORA, Protocol::OSTATUS, Protocol::DFRN])) {
- if (in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
+ if (in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
+ if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
$follow = System::baseUrl(true) . "/unfollow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Disconnect/Unfollow");
- } else {
- $follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
- $follow_text = L10n::t("Connect/Follow");
}
- }
-
- if ($contact['uid'] == 0) {
+ } else {
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Connect/Follow");
}
$sql_extra = " AND `blocked` = 0 ";
}
+ $sql_extra .= sprintf(" AND `network` != '%s' ", Protocol::PHANTOM);
+
$search = x($_GET, 'search') ? notags(trim($_GET['search'])) : '';
$nets = x($_GET, 'nets' ) ? notags(trim($_GET['nets'])) : '';