Ensure that "follow" requests can be processed

This commit is contained in:
Michael 2018-07-16 06:34:12 +00:00
parent 78c9e29aa8
commit 95fe08e5b9
1 changed files with 8 additions and 6 deletions

View 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)) {