From 990c70807dad6407d94acba098f9b574b5738a33 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Jul 2020 19:43:07 +0000 Subject: [PATCH 1/2] Fix notice "Undefined index: parent-uri" --- src/Model/Item.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index f7e7ae873..860d9d73c 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2001,6 +2001,7 @@ class Item $uids = Tag::getUIDListByURIId($item['uri-id']); foreach ($uids as $uid) { $original['uri-id'] = $item['uri-id']; + $original['gravity'] = $item['gravity']; $stored = self::storeForUser($original, $uid); Logger::info('Stored item for users', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'stored' => $stored]); } @@ -2189,7 +2190,7 @@ class Item $item['origin'] = 0; $item['wall'] = 0; - if ($item['uri'] == $item['parent-uri']) { + if ($item['gravity'] == GRAVITY_PARENT) { $contact = Contact::getByURLForUser($item['owner-link'], $uid, false, ['id']); } else { $contact = Contact::getByURLForUser($item['author-link'], $uid, false, ['id']); @@ -2212,7 +2213,7 @@ class Item /// @todo Handling of "event-id" $notify = false; - if ($item['uri'] == $item['parent-uri']) { + if ($item['gravity'] == GRAVITY_PARENT) { $contact = DBA::selectFirst('contact', [], ['id' => $item['contact-id'], 'self' => false]); if (DBA::isResult($contact)) { $notify = self::isRemoteSelf($contact, $item); From 5545bafdee61232e9afa0f7e257e8f7a61627bb8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Jul 2020 19:55:24 +0000 Subject: [PATCH 2/2] Fix notice "Undefined index: gravity in /src/Protocol/ActivityPub/Processor.php on line 556" --- src/Protocol/ActivityPub/Processor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 241907f62..db1492aa1 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -514,6 +514,10 @@ class Processor */ public static function postItem(array $activity, array $item) { + if (empty($item)) { + return; + } + $stored = false; foreach ($activity['receiver'] as $receiver) {