From a1dcbedc6f9fc1afbd15b3a1299d2182aeb7f262 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 18 Nov 2020 13:47:29 +0000 Subject: [PATCH 1/2] Fix Notice: Undefined variable: valid in /src/Protocol/OStatus.php on line 526 --- src/Protocol/OStatus.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index b8724acc7..a21b2a694 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -521,6 +521,12 @@ class OStatus Logger::log("Item with uri ".self::$itemlist[0]['uri']." will be imported since the thread contains posts or shares.", Logger::DEBUG); } } + } else { + // But we will only import complete threads + $valid = Item::exists(['uid' => $importer['uid'], 'uri' => self::$itemlist[0]['thr-parent']]); + if ($valid) { + Logger::info('Item is valid', ['uri' => self::$itemlist[0]["uri"], 'thr-parent' => self::$itemlist[0]['thr-parent'], 'user' => $importer["uid"]]); + } } if ($valid) { From f69c043bec5424f49c4e33cef5f0274ce5f5535f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 18 Nov 2020 18:07:20 +0100 Subject: [PATCH 2/2] Update src/Protocol/OStatus.php Co-authored-by: Hypolite Petovan --- src/Protocol/OStatus.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index a21b2a694..2cc815c32 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -522,11 +522,7 @@ class OStatus } } } else { - // But we will only import complete threads - $valid = Item::exists(['uid' => $importer['uid'], 'uri' => self::$itemlist[0]['thr-parent']]); - if ($valid) { - Logger::info('Item is valid', ['uri' => self::$itemlist[0]["uri"], 'thr-parent' => self::$itemlist[0]['thr-parent'], 'user' => $importer["uid"]]); - } + $valid = true; } if ($valid) {