From: Michael Date: Sat, 7 Mar 2020 23:19:19 +0000 (+0000) Subject: Issue 8151: Automatic Friend is working again X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e14ed2ce350306fb9989d23e66da64add1927711;p=friendica.git Issue 8151: Automatic Friend is working again --- diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 68bd0986a6..e4f142e3a2 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -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; }