- $r = q("SELECT `id`, `url`, `network`, `self` FROM `contact`
- WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra,
- dbesc($recip_str)
- );
+ if ($followup) {
+ $recipients = $recipients_followup;
+ }
+ $condition = ['id' => $recipients, 'self' => false,
+ 'blocked' => false, 'pending' => false, 'archive' => false];
+ if (!empty($networks)) {
+ $condition['network'] = $networks;
+ }
+ $contacts = dba::select('contact', ['id', 'url', 'network'], $condition);
+ $r = dba::inArray($contacts);