Add contact removal from all groups when blocked
This commit is contained in:
parent
7e499647e3
commit
b939faf4ef
|
@ -232,6 +232,11 @@ class Contact extends BaseObject
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2220,4 +2225,9 @@ class Contact extends BaseObject
|
|||
|
||||
return $redirect;
|
||||
}
|
||||
|
||||
public static function removeFromGroups($contact_id)
|
||||
{
|
||||
return DBA::delete('group_member', ['contact-id' => $contact_id]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user