Merge pull request #8380 from annando/issue-8151

Issue 8151: Automatic Friend is working again
This commit is contained in:
Hypolite Petovan 2020-03-07 18:33:32 -05:00 committed by GitHub
commit 95bfc094e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2653,8 +2653,17 @@ class Contact
]);
}
} elseif (DBA::isResult($user) && in_array($user['page-flags'], [User::PAGE_FLAGS_SOAPBOX, User::PAGE_FLAGS_FREELOVE, User::PAGE_FLAGS_COMMUNITY])) {
if (($user['page-flags'] == User::PAGE_FLAGS_FREELOVE) && ($network != Protocol::DIASPORA)) {
self::createFromProbe($importer['uid'], $url, false, $network);
}
$condition = ['uid' => $importer['uid'], 'url' => $url, 'pending' => true];
DBA::update('contact', ['pending' => false], $condition);
$fields = ['pending' => false];
if ($user['page-flags'] == User::PAGE_FLAGS_FREELOVE) {
$fields['rel'] = Contact::FRIEND;
}
DBA::update('contact', $fields, $condition);
return true;
}