aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Daemon/Notifier.php24
-rw-r--r--Zotlabs/Lib/Activity.php8
-rw-r--r--Zotlabs/Lib/Libzot.php2
-rw-r--r--include/items.php19
4 files changed, 27 insertions, 26 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index 4b7d43a45..043b406cc 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -241,11 +241,6 @@ class Notifier {
$target_item = $r[0];
- if (in_array($target_item['author']['xchan_network'], ['rss', 'anon', 'token'])) {
- logger('notifier: target item author is not a fetchable actor', LOGGER_DEBUG);
- return;
- }
-
if (intval($target_item['item_deleted'])) {
logger('notifier: target item ITEM_DELETED', LOGGER_DEBUG);
}
@@ -268,22 +263,9 @@ class Notifier {
}
- // Check for non published items, but allow an exclusion for transmitting hidden file activities
-
- if (intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) ||
- intval($target_item['item_blocked']) || intval($target_item['item_hidden'])) {
- logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG);
- return;
- }
-
- // follow/unfollow is for internal use only
- if (in_array($target_item['verb'], ['Follow', 'Ignore', ACTIVITY_FOLLOW, ACTIVITY_UNFOLLOW])) {
- logger('not fowarding follow/unfollow note activity');
- return;
- }
-
- if (strpos($target_item['postopts'], 'nodeliver') !== false) {
- logger('notifier: target item is undeliverable', LOGGER_DEBUG);
+ if (!item_forwardable($target_item)) {
+ //hz_syslog(print_r($target_item,true));
+ logger('notifier: target item not forwardable', LOGGER_DEBUG);
return;
}
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 055c2f27e..10df11174 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -3810,8 +3810,6 @@ class Activity {
->setObjType($object['type'])
->setParentMid(str_replace('/conversation/','/item/', $target))
->setThrParent(str_replace('/conversation/','/item/', $target))
- // ->setApproved($object['object']['id'] ?? '')
- // ->setReplyto(z_root() . '/channel/' . $channel['channel_address'])
->setTgtType('Collection')
->setTarget([
'id' => str_replace('/item/','/conversation/', $target),
@@ -3827,8 +3825,10 @@ class Activity {
->setDenyGid($sourceItem['deny_gid'])
->setPrivate($sourceItem['item_private'])
->setRestrict($sourceItem['item_restrict'])
- // ->setNocomment($sourceItem['item_nocomment'])
- // ->setCommentsClosed($sourceItem['comments_closed'])
+ ->setHidden($sourceItem['item_hidden'])
+ ->setDelayed($sourceItem['item_delayed'])
+ ->setUnpublished($sourceItem['item_unpublished'])
+ ->setBlocked($sourceItem['item_blocked'])
->setType($sourceItem['item_type'])
->setCommentPolicy($sourceItem['comment_policy'])
->setPublicPolicy($sourceItem['public_policy'])
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index e461ea8af..c9374d143 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1994,7 +1994,7 @@ class Libzot {
retain_item($stored['parent']);
}
- if ($relay && $item_id/* && $stored['item_blocked'] !== ITEM_MODERATED && $stored['obj_type'] !== 'Answer'*/) {
+ if ($relay && $item_id && item_forwardable($stored)) {
logger('Invoking relay');
Master::Summon(['Notifier', 'relay', intval($item_id)]);
if (!empty($approval) && $approval['item_id']) {
diff --git a/include/items.php b/include/items.php
index 037846e02..84e1e9aee 100644
--- a/include/items.php
+++ b/include/items.php
@@ -258,6 +258,25 @@ function item_normal() {
return $sql;
}
+function item_forwardable($item) {
+ if (intval($item['item_unpublished']) ||
+ intval($item['item_delayed']) ||
+ intval($item['item_blocked']) ||
+ intval($item['item_hidden']) ||
+ intval($item['item_restrict']) || // this might change in the future
+ // internal follow/unfollow thread
+ in_array($item['verb'], ['Follow', 'Ignore', ACTIVITY_FOLLOW, ACTIVITY_UNFOLLOW]) ||
+ str_contains($item['postopts'], 'nodeliver') ||
+ // actor not fetchable
+ (isset($item['author']['xchan_network']) && in_array($item['author']['xchan_network'], ['rss', 'anon', 'token']))
+
+ ) {
+ return false;
+ }
+
+ return true;
+}
+
function item_normal_search() {
return " and item.item_hidden = 0 and item.item_type in (0,3,6,7) and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0