mirror of
https://github.com/friendica/friendica
synced 2025-04-27 15:10:11 +00:00
Merge remote-tracking branch 'upstream/develop' into update-self
This commit is contained in:
commit
a0451e1c62
159 changed files with 7123 additions and 4877 deletions
|
@ -1582,4 +1582,29 @@ 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'];
|
||||
}
|
||||
|
||||
dba::close($stmt);
|
||||
|
||||
$contact_ids = $return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue