From 1f6e0f168ceafcd254403b40f752a21b82e8d923 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 24 Feb 2019 15:48:56 -0500 Subject: [PATCH 1/2] Add missing author contact in ActivityPub\Processor - Add logging for future occurrences - Addresses https://github.com/friendica/friendica/issues/6338#issuecomment-466812104 --- src/Protocol/ActivityPub/Processor.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 2661444e0c..e5ef354ba2 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -669,13 +669,16 @@ class Processor $parent_author = Contact::getDetailsByURL($parent['author-link'], 0); - $implicit_mentions = [ - $parent_author['url'], - $parent_author['nurl'], - $parent_author['alias'], - ]; + $implicit_mentions = []; + if (empty($parent_author)) { + Logger::notice('Author public contact unknown.', ['author-link' => $parent['author-link'], 'item-id' => $parent['id']]); + }else { + $implicit_mentions[] = $parent_author['url']; + $implicit_mentions[] = $parent_author['nurl']; + $implicit_mentions[] = $parent_author['alias']; + } - if ($parent['alias']) { + if (!empty($parent['alias'])) { $implicit_mentions[] = $parent['alias']; } From 3e290da8c261644ff0ad1a3cc0b1a506820bbf8f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 25 Feb 2019 03:16:18 -0500 Subject: [PATCH 2/2] Code standards: Add missing space in ActivityPub\Processor --- src/Protocol/ActivityPub/Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index e5ef354ba2..fafc26b733 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -672,7 +672,7 @@ class Processor $implicit_mentions = []; if (empty($parent_author)) { Logger::notice('Author public contact unknown.', ['author-link' => $parent['author-link'], 'item-id' => $parent['id']]); - }else { + } else { $implicit_mentions[] = $parent_author['url']; $implicit_mentions[] = $parent_author['nurl']; $implicit_mentions[] = $parent_author['alias'];