From defc89fa9a21e1ddcfd01c33240fc26d53d02996 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Jan 2019 22:30:26 +0000 Subject: [PATCH] Fixing the Accepting of contact requests --- src/Protocol/ActivityPub/Processor.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 1a631496b..057457ef3 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -370,6 +370,7 @@ class Processor $cid = Contact::getIdForURL($activity['actor'], $uid); if (!empty($cid)) { self::switchContact($cid); + DBA::update('contact', ['hub-verify' => $activity['id']], ['id' => $cid]); $contact = DBA::selectFirst('contact', [], ['id' => $cid, 'network' => Protocol::NATIVE_SUPPORT]); } else { $contact = false; @@ -387,7 +388,10 @@ class Processor return; } - DBA::update('contact', ['hub-verify' => $activity['id']], ['id' => $cid]); + if (empty($contact)) { + DBA::update('contact', ['hub-verify' => $activity['id']], ['id' => $cid]); + } + Logger::log('Follow user ' . $uid . ' from contact ' . $cid . ' with id ' . $activity['id']); }