}
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);
+ }
}
/**
{
$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]);
+ }
}