From 2bae4dde1fb4ee346a8aa5785f58bf0a2a94e2e6 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 30 Aug 2021 12:29:09 +0000 Subject: [PATCH] Avoid notices --- src/Model/Contact.php | 2 +- src/Protocol/ActivityPub/Transmitter.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index b59e7c2b5..93e745456 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2102,7 +2102,7 @@ class Contact $updated = DateTimeFormat::utcNow(); if (Strings::normaliseLink($contact['url']) != Strings::normaliseLink($ret['url'])) { - Logger::notice('New URL differs from old URL', ['id' => $id, 'uid' => $contact['uid'], 'old' => $contact['url'], 'new' => $ret['url']]); + Logger::notice('New URL differs from old URL', ['id' => $id, 'uid' => $uid, 'old' => $contact['url'], 'new' => $ret['url']]); self::updateContact($id, $uid, $contact['url'], $ret['url'], ['failed' => true, 'last-update' => $updated, 'failure_update' => $updated]); return false; } diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index ab23f81d8..bd43eea04 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -877,6 +877,9 @@ class Transmitter } $reply = DBA::selectFirst('mail', ['uri', 'uri-id', 'from-url'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]); + if (!DBA::isResult($reply)) { + $reply = $mail; + } // Making the post more compatible for Mastodon by: // - Making it a note and not an article (no title)