]> git.mxchange.org Git - friendica.git/commitdiff
AP Bugfix: Following a soapbox now works / rapid follow/unfollow should work now
authorMichael <heluecht@pirati.ca>
Fri, 5 Oct 2018 06:35:50 +0000 (06:35 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 5 Oct 2018 06:35:50 +0000 (06:35 +0000)
src/Model/Contact.php
src/Protocol/ActivityPub/Processor.php

index 3ffd5b2af5e2f45208287ffbf3a7129c1afa7377..fa6966a0eff8c66144cc4eaffc7d00cc022429b9 100644 (file)
@@ -1917,6 +1917,12 @@ class Contact extends BaseObject
                        } elseif (DBA::isResult($user) && in_array($user['page-flags'], [self::PAGE_SOAPBOX, self::PAGE_FREELOVE, self::PAGE_COMMUNITY])) {
                                $condition = ['uid' => $importer['uid'], 'url' => $url, 'pending' => true];
                                DBA::update('contact', ['pending' => false], $condition);
+
+                               $contact = DBA::selectFirst('contact', ['url', 'network', 'hub-verify'], ['id' => $contact_record['id']]);
+
+                               if ($contact['network'] == Protocol::ACTIVITYPUB) {
+                                       ActivityPub\Transmitter::sendContactAccept($contact['url'], $contact['hub-verify'], $importer['uid']);
+                               }
                        }
                }
        }
index 2e93e1bc1886eb430df8b31fc0bbff3a25ae034e..c3fd88f0d2a20df1c2449ee82f9f5c3a15691003 100644 (file)
@@ -283,7 +283,7 @@ class Processor
 
                $cid = Contact::getIdForURL($activity['owner'], $uid);
                if (!empty($cid)) {
-                       $contact = DBA::selectFirst('contact', [], ['id' => $cid]);
+                       $contact = DBA::selectFirst('contact', [], ['id' => $cid, 'network' => Protocol::NATIVE_SUPPORT]);
                } else {
                        $contact = false;
                }