mirror of
https://github.com/friendica/friendica
synced 2025-04-27 15:10:11 +00:00
Allow special groups in default user permissions
- Use ACLFormatter in ACL::getDefaultUserPermissions - Remove ACL::fixACL - Add return value to Contact::pruneUnavailable
This commit is contained in:
parent
755b9daa45
commit
64c8855407
3 changed files with 16 additions and 43 deletions
|
@ -2682,26 +2682,23 @@ class Contact
|
|||
* Remove the unavailable contact ids from the provided list
|
||||
*
|
||||
* @param array $contact_ids Contact id list
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function pruneUnavailable(array &$contact_ids)
|
||||
public static function pruneUnavailable(array $contact_ids)
|
||||
{
|
||||
if (empty($contact_ids)) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
|
||||
$str = DBA::escape(implode(',', $contact_ids));
|
||||
$contacts = Contact::selectToArray(['id'], [
|
||||
'id' => $contact_ids,
|
||||
'blocked' => false,
|
||||
'pending' => false,
|
||||
'archive' => false,
|
||||
]);
|
||||
|
||||
$stmt = DBA::p("SELECT `id` FROM `contact` WHERE `id` IN ( " . $str . ") AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0");
|
||||
|
||||
$return = [];
|
||||
while($contact = DBA::fetch($stmt)) {
|
||||
$return[] = $contact['id'];
|
||||
}
|
||||
|
||||
DBA::close($stmt);
|
||||
|
||||
$contact_ids = $return;
|
||||
return array_column($contacts, 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue