]> git.mxchange.org Git - friendica.git/commitdiff
Ensure that "follow" requests can be processed
authorMichael <heluecht@pirati.ca>
Mon, 16 Jul 2018 06:34:12 +0000 (06:34 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 16 Jul 2018 06:34:12 +0000 (06:34 +0000)
src/Protocol/DFRN.php

index 4c4f629d0d4f5ab4e4ca7ac7224307d720627928..79fa000f176571af17655f53d52fccda7b9ce2e7 100644 (file)
@@ -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)) {