}
DBA::update('user-contact', ['blocked' => $blocked], ['cid' => $cdata['public'], 'uid' => $uid], true);
+
+ if ($blocked) {
+ // Blocked contact can't be in any group
+ self::removeFromGroups($cid);
+ }
}
/**
DBA::update('contact', ['archive' => true, 'network' => Protocol::PHANTOM, 'deleted' => true], ['id' => $id]);
// Delete it in the background
- Worker::add(PRIORITY_LOW, 'RemoveContact', $id);
+ Worker::add(PRIORITY_MEDIUM, 'RemoveContact', $id);
}
/**
$sparkle = false;
if (($contact['network'] === Protocol::DFRN) && !$contact['self']) {
$sparkle = true;
- $profile_link = System::baseUrl() . '/redir/' . $contact['id'];
+ $profile_link = System::baseUrl() . '/redir/' . $contact['id'] . '?url=' . $contact['url'];
} else {
$profile_link = $contact['url'];
}
}
if ($sparkle) {
- $status_link = $profile_link . '?url=status';
- $photos_link = $profile_link . '?url=photos';
- $profile_link = $profile_link . '?url=profile';
+ $status_link = $profile_link . '?tab=status';
+ $photos_link = str_replace('/profile/', '/photos/', $profile_link);
+ $profile_link = $profile_link . '?tab=profile';
}
if (in_array($contact['network'], [Protocol::DFRN, Protocol::DIASPORA]) && !$contact['self']) {
{
$contact = DBA::selectFirst('contact', ['id', 'network', 'url', 'uid'], ['id' => $cid]);
- return self::magicLinkbyContact($contact, $url);
+ return self::magicLinkByContact($contact, $url);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- public static function magicLinkbyContact($contact, $url = '')
+ public static function magicLinkByContact($contact, $url = '')
{
if ((!local_user() && !remote_user()) || ($contact['network'] != Protocol::DFRN)) {
return $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
return $redirect;
}
+
+ public static function removeFromGroups($contact_id)
+ {
+ return DBA::delete('group_member', ['contact-id' => $contact_id]);
+ }
}