mirror of
https://github.com/friendica/friendica
synced 2025-04-27 15:10:11 +00:00
Add new class/functions
- Create class Core\Acl - Add Contact::pruneUnavailable - Add mod_content
This commit is contained in:
parent
38e5e64532
commit
eeafb59c31
3 changed files with 708 additions and 4 deletions
|
@ -1517,4 +1517,27 @@ class Contact extends BaseObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the unavailable contact ids from the provided list
|
||||
*
|
||||
* @param array $contact_ids Contact id list
|
||||
*/
|
||||
public static function pruneUnavailable(array &$contact_ids)
|
||||
{
|
||||
if (empty($contact_ids)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$str = dbesc(implode(',', $contact_ids));
|
||||
|
||||
$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'];
|
||||
}
|
||||
|
||||
$contact_ids = $return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue