]> git.mxchange.org Git - friendica.git/commitdiff
Issue 6167: Don't publish non visible content
authorMichael <heluecht@pirati.ca>
Fri, 15 Mar 2019 20:31:07 +0000 (20:31 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 15 Mar 2019 20:31:07 +0000 (20:31 +0000)
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/DFRN.php
src/Worker/Delivery.php
src/Worker/Notifier.php

index 94012e4d639be82e91b618e1a0f59c92c74a60a1..d85f67a7ccf126638517ac684a604bf207e4f1a7 100644 (file)
@@ -152,7 +152,7 @@ class Transmitter
 
                $condition = ['uid' => 0, 'contact-id' => $public_contact, 'author-id' => $public_contact,
                        'private' => false, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT],
-                       'deleted' => false, 'visible' => true];
+                       'deleted' => false, 'visible' => true, 'moderated' => false];
                $count = DBA::count('item', $condition);
 
                $data = ['@context' => ActivityPub::CONTEXT];
index efd3c4aa606a0320ba5da97f8682379801d0e639..8433801812d5975cc53c47f46adc5a5436ac4377 100644 (file)
@@ -254,7 +254,7 @@ class DFRN
                        FROM `item` USE INDEX (`uid_wall_changed`) $sql_post_table
                        STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                        WHERE `item`.`uid` = %d AND `item`.`wall` AND `item`.`changed` > '%s'
-                       $sql_extra
+                       AND `item`.`visible` $sql_extra
                        ORDER BY `item`.`parent` ".$sort.", `item`.`created` ASC LIMIT 0, 300",
                        intval($owner_id),
                        DBA::escape($check_date),
index 34394ae4811f82ee67faddd3a560e56aa0d845ec..917a83ccbbb104a8af1bb2dd12ff703eda618bb0 100644 (file)
@@ -60,7 +60,7 @@ class Delivery extends BaseObject
                        }
                        $parent_id = intval($item['parent']);
 
-                       $condition = ['id' => [$target_id, $parent_id], 'moderated' => false];
+                       $condition = ['id' => [$target_id, $parent_id], 'visible' => true, 'moderated' => false];
                        $params = ['order' => ['id']];
                        $itemdata = Model\Item::select([], $condition, $params);
 
index 58460329b4754b7d23f1d993a1fa6e4b6f055ade..baae33f7e0f3d8f2015e7756e582957005a00660 100644 (file)
@@ -99,11 +99,6 @@ class Notifier
                                return;
                        }
 
-                       // Issue 6167: We don't distribute image uploads
-                       if ($target_item['post-type'] == Item::PT_IMAGE) {
-                               return;
-                       }
-
                        if (!empty($target_item['contact-uid'])) {
                                $uid = $target_item['contact-uid'];
                        } elseif (!empty($target_item['uid'])) {