From 8707ced2f7710c1e4d60ac6ad1be3e567f2f3875 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 16 Jun 2020 20:30:25 +0000 Subject: [PATCH 1/2] Hopefully fixes notice "Undefined index: gravity" --- src/Model/Contact.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index c46b15b94..04cece535 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -843,6 +843,7 @@ class Contact // create an unfollow slap $item = []; $item['verb'] = Activity::O_UNFOLLOW; + $item['gravity'] = GRAVITY_ACTIVITY; $item['follow'] = $contact["url"]; $item['body'] = ''; $item['title'] = ''; @@ -2470,6 +2471,7 @@ class Contact // create a follow slap $item = []; $item['verb'] = Activity::FOLLOW; + $item['gravity'] = GRAVITY_ACTIVITY; $item['follow'] = $contact["url"]; $item['body'] = ''; $item['title'] = ''; From 1a86167ac589777b3fb5f8c6dcf7f4f302a3785f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 16 Jun 2020 20:41:34 +0000 Subject: [PATCH 2/2] Possibly fix "Undefined index: url" --- src/Protocol/ActivityPub/Processor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 02ea24224..43aebce64 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -989,7 +989,7 @@ class Processor $parent_author = Contact::getDetailsByURL($parent['author-link'], 0); $implicit_mentions = []; - if (empty($parent_author)) { + if (empty($parent_author['url'])) { Logger::notice('Author public contact unknown.', ['author-link' => $parent['author-link'], 'item-id' => $parent['id']]); } else { $implicit_mentions[] = $parent_author['url']; @@ -1003,7 +1003,7 @@ class Processor foreach ($parent_terms as $term) { $contact = Contact::getDetailsByURL($term['url'], 0); - if (!empty($contact)) { + if (!empty($contact['url'])) { $implicit_mentions[] = $contact['url']; $implicit_mentions[] = $contact['nurl']; $implicit_mentions[] = $contact['alias'];