]> git.mxchange.org Git - friendica.git/commitdiff
Issue 8151: Automatic Friend is working again
authorMichael <heluecht@pirati.ca>
Sat, 7 Mar 2020 23:19:19 +0000 (23:19 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 7 Mar 2020 23:19:19 +0000 (23:19 +0000)
src/Model/Contact.php

index 68bd0986a663e144011bb4060a2139ff4ad14876..e4f142e3a2d93d06bfb74ef3d6fad368de333489 100644 (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;
                        }