}
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);
+ }
}
/**
return $redirect;
}
+
+ public static function removeFromGroups($contact_id)
+ {
+ return DBA::delete('group_member', ['contact-id' => $contact_id]);
+ }
}