X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FNotifier.php;h=e3eb6810a3c418915a0d57e5c5ee3ad038cfd80f;hb=52a799574d3475c97e970e041d1577850920d0ef;hp=ac8cf123c5a8d4e6a02109877b80a12b7bcf682e;hpb=4032ad341832dc6ca86f1aa327e13aa087430e14;p=friendica.git diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index ac8cf123c5..e3eb6810a3 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -7,19 +7,20 @@ namespace Friendica\Worker; use Friendica\Core\Config; use Friendica\Core\Worker; use Friendica\Database\DBM; +use Friendica\Model\Contact; +use Friendica\Model\Group; use Friendica\Network\Probe; -use Friendica\Object\Contact; use Friendica\Protocol\Diaspora; use Friendica\Protocol\OStatus; +use Friendica\Protocol\Salmon; use dba; +require_once 'include/dba.php'; require_once 'include/queue_fn.php'; require_once 'include/html2plain.php'; -require_once 'include/salmon.php'; require_once 'include/datetime.php'; require_once 'include/items.php'; require_once 'include/bbcode.php'; -require_once 'include/email.php'; /* * This file was at one time responsible for doing all deliveries, but this caused @@ -108,7 +109,7 @@ class Notifier { $recipients[] = $suggest[0]['cid']; $item = $suggest[0]; } elseif ($cmd === 'removeme') { - $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`, + $r = q("SELECT `contact`.*, `user`.`prvkey` AS `uprvkey`, `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`, `user`.`guid` FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid` @@ -173,7 +174,7 @@ class Notifier { } - $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`, + $r = q("SELECT `contact`.*, `user`.`prvkey` AS `uprvkey`, `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`page-flags`, `user`.`prvnets`, `user`.`account-type` FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid` @@ -208,8 +209,6 @@ class Notifier { $slap = OStatus::salmon($target_item, $owner); - require_once 'include/group.php'; - $parent = $items[0]; $thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d", @@ -350,9 +349,9 @@ class Notifier { } $allow_people = expand_acl($parent['allow_cid']); - $allow_groups = expand_groups(expand_acl($parent['allow_gid']),true); + $allow_groups = Group::expand(expand_acl($parent['allow_gid']),true); $deny_people = expand_acl($parent['deny_cid']); - $deny_groups = expand_groups(expand_acl($parent['deny_gid'])); + $deny_groups = Group::expand(expand_acl($parent['deny_gid'])); // if our parent is a public forum (forum_mode == 1), uplink to the origional author causing // a delivery fork. private groups (forum_mode == 2) do not uplink @@ -448,7 +447,7 @@ class Notifier { // It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."')"; } else { - $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."', '".NETWORK_MAIL2."')"; + $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."')"; } } else { $public_message = false; @@ -506,11 +505,11 @@ class Notifier { // They are especially used for notifications to OStatus users that don't follow us. if ($slap && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) { - if (!Config::get('system','dfrn_only')) { + if (!Config::get('system', 'dfrn_only')) { foreach ($url_recipients as $url) { if ($url) { logger('notifier: urldelivery: ' . $url); - $deliver_status = slapper($owner,$url,$slap); + $deliver_status = Salmon::slapper($owner, $url, $slap); /// @TODO Redeliver/queue these items on failure, though there is no contact record } } @@ -538,9 +537,8 @@ class Notifier { } $r2 = q("SELECT `id`, `name`,`network` FROM `contact` - WHERE `network` in ('%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `rel` != %d", + WHERE `network` in ('%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `rel` != %d", dbesc(NETWORK_DFRN), - dbesc(NETWORK_MAIL2), intval($owner['uid']), intval(CONTACT_IS_SHARING) );