From 3b7e9cc3a25c4b2ab2e58ddf3eda64840456b37c Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sun, 10 Feb 2019 18:59:05 +0000
Subject: [PATCH] This now should really prevent sending the follow requests
 only once

---
 src/Protocol/ActivityPub/Processor.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php
index a0630fe6c0..25f064fd6a 100644
--- a/src/Protocol/ActivityPub/Processor.php
+++ b/src/Protocol/ActivityPub/Processor.php
@@ -360,8 +360,8 @@ class Processor
 			$item_id = Item::insert($item);
 			Logger::log('Storing for user ' . $item['uid'] . ': ' . $item_id);
 
-			if ($item_id) {
-				$stored = true;
+			if ($item['uid'] == 0) {
+				$stored = $item_id;
 			}
 		}
 
@@ -370,7 +370,7 @@ class Processor
 			$author = APContact::getByURL($item['owner-link'], false);
 			// We send automatic follow requests for reshared messages. (We don't need though for forum posts)
 			if ($author['type'] != 'Group') {
-				Logger::log('Send follow request for ' . $item['uri'] . ' to ' . $item['author-link'], Logger::DEBUG);
+				Logger::log('Send follow request for ' . $item['uri'] . ' (' . $stored . ') to ' . $item['author-link'], Logger::DEBUG);
 				ActivityPub\Transmitter::sendFollowObject($item['uri'], $item['author-link']);
 			}
 		}
-- 
2.39.5