From: Michael Date: Sun, 10 Feb 2019 18:03:01 +0000 (+0000) Subject: Prevent multiple send follow requests X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=58eaf0ba1c42e49d5cede907a0bd5939629764f6;p=friendica.git Prevent multiple send follow requests --- diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 1032627b32..ebd32786a8 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -1317,6 +1317,13 @@ class Transmitter $uid = $first_user['uid']; } + $condition = ['verb' => ACTIVITY_FOLLOW, 'uid' => 0, 'parent-uri' => $object, + 'author-id' => Contact::getPublicIdByUserId($uid)]; + if (Item::exists($condition)) { + Logger::log('Follow for ' . $object . ' for user ' . $uid . ' does already exist.', Logger::DEBUG); + return false; + } + $owner = User::getOwnerDataById($uid); $data = ['@context' => ActivityPub::CONTEXT,