<?php
/**
- * @file src/Worker/Notifier.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
*/
+
namespace Friendica\Worker;
use Friendica\Core\Hook;
use Friendica\Model\Conversation;
use Friendica\Model\Group;
use Friendica\Model\Item;
-use Friendica\Model\ItemDeliveryData;
+use Friendica\Model\Post;
use Friendica\Model\PushSubscriber;
use Friendica\Model\User;
use Friendica\Network\Probe;
// If this is a public conversation, notify the feed hub
$public_message = true;
+ $unlisted = false;
+
// Do a PuSH
$push_notify = false;
Logger::info('Threaded comment', ['diaspora_delivery' => (int)$diaspora_delivery]);
}
+ $unlisted = $target_item['private'] == Item::UNLISTED;
+
// This is IMPORTANT!!!!
// We will only send a "notify owner to relay" or followup message if the referenced post
Logger::info('Followup', ['target' => $target_id, 'guid' => $target_item['guid'], 'to' => $parent['contact-id']]);
- //if (!$target_item['private'] && $target_item['wall'] &&
- if (!$target_item['private'] &&
+ if (($target_item['private'] != Item::PRIVATE) &&
(strlen($target_item['allow_cid'].$target_item['allow_gid'].
$target_item['deny_cid'].$target_item['deny_gid']) == 0))
$push_notify = true;
if ($public_message && !in_array($cmd, [Delivery::MAIL, Delivery::SUGGESTION]) && !$followup) {
$relay_list = [];
- if ($diaspora_delivery) {
+ if ($diaspora_delivery && !$unlisted) {
$batch_delivery = true;
$relay_list_stmt = DBA::p(
/// @TODO Redeliver/queue these items on failure, though there is no contact record
$delivery_queue_count++;
Salmon::slapper($owner, $url, $slap);
- ItemDeliveryData::incrementQueueDone($target_id, ItemDeliveryData::OSTATUS);
+ Post\DeliveryData::incrementQueueDone($target_item['uri-id'], Post\DeliveryData::OSTATUS);
}
}
// Workaround for pure connector posts
if (in_array($cmd, [Delivery::POST, Delivery::POKE])) {
if ($delivery_queue_count == 0) {
- ItemDeliveryData::incrementQueueDone($target_item['id']);
+ Post\DeliveryData::incrementQueueDone($target_item['uri-id']);
$delivery_queue_count = 1;
}
- ItemDeliveryData::incrementQueueCount($target_item['id'], $delivery_queue_count);
+ Post\DeliveryData::incrementQueueCount($target_item['uri-id'], $delivery_queue_count);
}
}