From 95fe08e5b96738b216b1ee70e624d70f378316cf Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 16 Jul 2018 06:34:12 +0000 Subject: [PATCH] Ensure that "follow" requests can be processed --- src/Protocol/DFRN.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 4c4f629d0d..79fa000f17 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2624,17 +2624,12 @@ class DFRN $item["type"] = "remote-comment"; $item["wall"] = 1; } elseif ($entrytype == DFRN::TOP_LEVEL) { - if ($owner_unknown) { - logger("Item won't be stored because user " . $importer["importer_uid"] . " doesn't follow " . $item["owner-link"] . ".", LOGGER_DEBUG); - return; - } - if (!isset($item["object-type"])) { $item["object-type"] = ACTIVITY_OBJ_NOTE; } // Is it an event? - if ($item["object-type"] == ACTIVITY_OBJ_EVENT) { + if (($item["object-type"] == ACTIVITY_OBJ_EVENT) && !$owner_unknown) { logger("Item ".$item["uri"]." seems to contain an event.", LOGGER_DEBUG); $ev = Event::fromBBCode($item["body"]); if ((x($ev, "desc") || x($ev, "summary")) && x($ev, "start")) { @@ -2667,6 +2662,13 @@ class DFRN return; } + // This check is done here to be able to receive connection requests in "processVerbs" + if (($entrytype == DFRN::TOP_LEVEL) && $owner_unknown) { + logger("Item won't be stored because user " . $importer["importer_uid"] . " doesn't follow " . $item["owner-link"] . ".", LOGGER_DEBUG); + return; + } + + // Update content if 'updated' changes if (DBM::is_result($current)) { if (self::updateContent($current, $item, $importer, $entrytype)) {