X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FNotifier.php;h=385892f9916047ae61931d48cbe1301f8afaa5c1;hb=d993c8584c4c2b6023606e727ea3e0db6a6bde51;hp=fcf36bd55ab41a589a6b49fdddfb0b30e88c92e3;hpb=8a3cae686b9067b43055a5d3ee7ba3313b88f495;p=friendica.git diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index fcf36bd55a..385892f991 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -48,9 +48,11 @@ require_once 'include/items.php'; * and ITEM_ID is the id of the item in the database that needs to be sent to others. */ -class Notifier { - public static function execute($cmd, $item_id) { - global $a; +class Notifier +{ + public static function execute($cmd, $item_id) + { + $a = \Friendica\BaseObject::getApp(); logger('notifier: invoked: '.$cmd.': '.$item_id, LOGGER_DEBUG); @@ -167,7 +169,7 @@ class Notifier { $fields = ['network', 'author-id', 'owner-id']; $condition = ['uri' => $target_item["thr-parent"], 'uid' => $target_item["uid"]]; - $thr_parent = dba::selectFirst('item', $fields, $condition); + $thr_parent = Item::selectFirst($fields, $condition); logger('GUID: '.$target_item["guid"].': Parent is '.$parent['network'].'. Thread parent is '.$thr_parent['network'], LOGGER_DEBUG); @@ -378,7 +380,7 @@ class Notifier { } // If this is a public message and pubmail is set on the parent, include all your email contacts - if (function_exists('imap_open') && !Config::get('system','imap_disabled')) { + 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'])) { @@ -412,7 +414,7 @@ class Notifier { // delivery loop if (DBM::is_result($r)) { foreach ($r as $contact) { - logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG); + logger("Deliver ".$item_id." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG); Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true], 'Delivery', $cmd, $item_id, (int)$contact['id']);