Merge pull request #5824 from annando/fix-follow

Following a soapbox now works / rapid follow/unfollow should work now
This commit is contained in:
Hypolite Petovan 2018-10-05 07:49:36 -04:00 committed by GitHub
commit be7bd10678
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View 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])) { } 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]; $condition = ['uid' => $importer['uid'], 'url' => $url, 'pending' => true];
DBA::update('contact', ['pending' => false], $condition); 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']);
}
} }
} }
} }

View file

@ -283,7 +283,7 @@ class Processor
$cid = Contact::getIdForURL($activity['owner'], $uid); $cid = Contact::getIdForURL($activity['owner'], $uid);
if (!empty($cid)) { if (!empty($cid)) {
$contact = DBA::selectFirst('contact', [], ['id' => $cid]); $contact = DBA::selectFirst('contact', [], ['id' => $cid, 'network' => Protocol::NATIVE_SUPPORT]);
} else { } else {
$contact = false; $contact = false;
} }