]> git.mxchange.org Git - friendica.git/commitdiff
Don't relay participation messages
authorMichael <heluecht@pirati.ca>
Wed, 6 May 2020 20:43:00 +0000 (20:43 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 6 May 2020 20:43:00 +0000 (20:43 +0000)
src/Model/Item.php

index 17c841fc2f4e517e56d2c7b9915fd073fe86710b..ff3ec9a72ed1f39377d8b5e8ea156f8907c6016d 100644 (file)
@@ -1989,7 +1989,18 @@ class Item
 
                check_user_notification($current_post);
 
-               if ($notify || ($item['visible'] && ((!empty($parent) && $parent['origin']) || $item['origin']))) {
+               $transmit = $notify || ($item['visible'] && ((!empty($parent) && $parent['origin']) || $item['origin']));
+
+               if ($transmit) {
+                       $transmit_item = Item::selectFirst(['verb', 'origin'], ['id' => $item['id']]);
+                       // Don't relay participation messages
+                       if (($transmit_item['verb'] == Activity::FOLLOW) && !$transmit_item['origin']) {
+                               Logger::info('Participation messages will not be relayed', ['item' => $item['id'], 'uri' => $item['uri'], 'verb' => $transmit_item['verb']]);
+                               $transmit = false;
+                       }
+               }
+
+               if ($transmit) {
                        Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $notify_type, $current_post);
                }