- // If this is a public message and pubmail is set on the parent, include all your email contacts
- if (!empty($target_item) && function_exists('imap_open') && !Config::get('system','imap_disabled')) {
- if (!strlen($target_item['allow_cid']) && !strlen($target_item['allow_gid'])
- && !strlen($target_item['deny_cid']) && !strlen($target_item['deny_gid'])
- && intval($target_item['pubmail'])) {
- $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s'",
- intval($uid),
- DBA::escape(Protocol::MAIL)
- );
- if (DBA::isResult($r)) {
- foreach ($r as $rr) {
- $recipients[] = $rr['id'];
- }
- }
- }
- }
-
- if ($cmd == Delivery::RELOCATION) {
- $contacts = $recipients_relocate;
- } else {