]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Remove next link when there aren't any introductions in Module\Api\Mastodon\FollowReq...
[friendica.git] / src / Model / Contact.php
index 9cbf591de0599da3dc9ba5d68cd507462c52a2aa..3897f821b7f2820f408df6fb19278ebb40e533c7 100644 (file)
@@ -6,7 +6,6 @@ namespace Friendica\Model;
 
 use Friendica\App\BaseURL;
 use Friendica\Content\Pager;
-use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
@@ -722,9 +721,9 @@ class Contact
                        return;
                }
 
-               $fields = ['name', 'photo', 'thumb', 'about', 'address', 'locality', 'region',
-                       'country-name', 'gender', 'pub_keywords', 'xmpp', 'net-publish'];
-               $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid, 'is-default' => true]);
+               $fields = ['name', 'photo', 'thumb', 'pdesc' => 'about', 'address', 'locality', 'region',
+                       'country-name', 'pub_keywords', 'xmpp', 'net-publish'];
+               $profile = DBA::selectFirst('profile', $fields, ['uid' => $uid]);
                if (!DBA::isResult($profile)) {
                        return;
                }
@@ -734,7 +733,7 @@ class Contact
                $fields = ['name' => $profile['name'], 'nick' => $user['nickname'],
                        'avatar-date' => $self['avatar-date'], 'location' => Profile::formatLocation($profile),
                        'about' => $profile['about'], 'keywords' => $profile['pub_keywords'],
-                       'gender' => $profile['gender'], 'contact-type' => $user['account-type'],
+                       'gender' => '', 'contact-type' => $user['account-type'],
                        'xmpp' => $profile['xmpp']];
 
                $avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
@@ -801,7 +800,7 @@ class Contact
                        // Update the profile
                        $fields = ['photo' => DI::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix,
                                'thumb' => DI::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
-                       DBA::update('profile', $fields, ['uid' => $uid, 'is-default' => true]);
+                       DBA::update('profile', $fields, ['uid' => $uid]);
                }
        }
 
@@ -919,7 +918,7 @@ class Contact
                         */
 
                        /// @todo Check for contact vitality via probing
-                       $archival_days = Config::get('system', 'archival_days', 32);
+                       $archival_days = DI::config()->get('system', 'archival_days', 32);
 
                        $expiry = $contact['term-date'] . ' + ' . $archival_days . ' days ';
                        if (DateTimeFormat::utcNow() > DateTimeFormat::utc($expiry)) {
@@ -1231,9 +1230,9 @@ class Contact
                }
 
                if ($sparkle) {
-                       $status_link = $profile_link . '?tab=status';
+                       $status_link = $profile_link . '/status';
                        $photos_link = str_replace('/profile/', '/photos/', $profile_link);
-                       $profile_link = $profile_link . '?tab=profile';
+                       $profile_link = $profile_link . '/profile';
                }
 
                if (self::canReceivePrivateMessages($contact) && empty($contact['pending'])) {
@@ -2322,7 +2321,7 @@ class Contact
 
                                // NOTREACHED
                        }
-               } elseif (Config::get('system', 'dfrn_only') && ($ret['network'] != Protocol::DFRN)) {
+               } elseif (DI::config()->get('system', 'dfrn_only') && ($ret['network'] != Protocol::DFRN)) {
                        $result['message'] = DI::l10n()->t('This site is not configured to allow communications with other networks.') . EOL;
                        $result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . EOL;
                        return $result;
@@ -2352,7 +2351,7 @@ class Contact
                        return $result;
                }
 
-               if ($protocol === Protocol::OSTATUS && Config::get('system', 'ostatus_disabled')) {
+               if ($protocol === Protocol::OSTATUS && DI::config()->get('system', 'ostatus_disabled')) {
                        $result['message'] .= DI::l10n()->t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
                        $ret['notify'] = '';
                }
@@ -2639,7 +2638,7 @@ class Contact
                                                'to_name'      => $user['username'],
                                                'to_email'     => $user['email'],
                                                'uid'          => $user['uid'],
-                                               'link'         => DI::baseUrl() . '/notifications/intro',
+                                               'link'         => DI::baseUrl() . '/notifications/intros',
                                                'source_name'  => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : DI::l10n()->t('[Name Withheld]')),
                                                'source_link'  => $contact_record['url'],
                                                'source_photo' => $contact_record['photo'],