]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/GContact.php
Merge pull request #8344 from MrPetovan/bug/8339-remote-follow-local-profile
[friendica.git] / src / Model / GContact.php
index 05f20ec5b8063822cced6ea70aa276b838135f3f..95afc1be6e0817573aa6258425d0161a1bd8da10 100644 (file)
@@ -1,8 +1,24 @@
 <?php
 /**
- * @file src/Model/GlobalContact.php
- * This file includes the GlobalContact class with directory related functions
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
+
 namespace Friendica\Model;
 
 use DOMDocument;
@@ -658,7 +674,7 @@ class GContact
                }
 
                $public_contact = DBA::selectFirst('gcontact', [
-                       'name', 'nick', 'photo', 'location', 'about', 'addr', 'generation', 'birthday', 'gender', 'keywords',
+                       'name', 'nick', 'photo', 'location', 'about', 'addr', 'generation', 'birthday', 'keywords',
                        'contact-type', 'hide', 'nsfw', 'network', 'alias', 'notify', 'server_url', 'connect', 'updated', 'url'
                ], ['id' => $gcontact_id]);
 
@@ -753,7 +769,7 @@ class GContact
                                'photo' => $contact['photo'], 'name' => $contact['name'],
                                'nick' => $contact['nick'], 'addr' => $contact['addr'],
                                'network' => $contact['network'], 'birthday' => $contact['birthday'],
-                               'gender' => $contact['gender'], 'keywords' => $contact['keywords'],
+                               'keywords' => $contact['keywords'],
                                'hide' => $contact['hide'], 'nsfw' => $contact['nsfw'],
                                'contact-type' => $contact['contact-type'], 'alias' => $contact['alias'],
                                'notify' => $contact['notify'], 'url' => $contact['url'],
@@ -981,7 +997,7 @@ class GContact
         */
        private static function updateFromPublicContact($condition)
        {
-               $fields = ['name', 'nick', 'url', 'nurl', 'location', 'about', 'keywords', 'gender',
+               $fields = ['name', 'nick', 'url', 'nurl', 'location', 'about', 'keywords',
                        'bd', 'contact-type', 'network', 'addr', 'notify', 'alias', 'archive', 'term-date',
                        'created', 'updated', 'avatar', 'success_update', 'failure_update', 'forum', 'prv',
                        'baseurl', 'sensitive', 'unsearchable'];
@@ -991,7 +1007,7 @@ class GContact
                        return 0;
                }
 
-               $fields = ['name', 'nick', 'url', 'nurl', 'location', 'about', 'keywords', 'gender', 'generation',
+               $fields = ['name', 'nick', 'url', 'nurl', 'location', 'about', 'keywords', 'generation',
                        'birthday', 'contact-type', 'network', 'addr', 'notify', 'alias', 'archived', 'archive_date',
                        'created', 'updated', 'photo', 'last_contact', 'last_failure', 'community', 'connect',
                        'server_url', 'nsfw', 'hide', 'id'];
@@ -1005,7 +1021,7 @@ class GContact
                $gcontact = [];
 
                // These fields are identical in both contact and gcontact
-               $fields = ['name', 'nick', 'url', 'nurl', 'location', 'about', 'keywords', 'gender',
+               $fields = ['name', 'nick', 'url', 'nurl', 'location', 'about', 'keywords',
                        'contact-type', 'network', 'addr', 'notify', 'alias', 'created', 'updated'];
 
                foreach ($fields as $field) {
@@ -1117,10 +1133,10 @@ class GContact
                );
 
                $gcontact = ['name' => $userdata['name'], 'location' => $location, 'about' => $userdata['about'],
-                               'gender' => '', 'keywords' => $userdata['pub_keywords'],
+                               'keywords' => $userdata['pub_keywords'],
                                'birthday' => $userdata['dob'], 'photo' => $userdata['photo'],
                                "notify" => $userdata['notify'], 'url' => $userdata['url'],
-                               "hide" => ($userdata['hidewall'] || !$userdata['net-publish']),
+                               "hide" => !$userdata['net-publish'],
                                'nick' => $userdata['nickname'], 'addr' => $userdata['addr'],
                                "connect" => $userdata['addr'], "server_url" => DI::baseUrl(),
                                "generation" => 1, 'network' => Protocol::DFRN];