]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Profile.php
Merge pull request #10619 from nupplaphil/task/guzzlehttp
[friendica.git] / src / Model / Profile.php
index 980cd204e343209876179c77a900e186122ed8b6..80775c9e86b9e09416083a7e8ef3f5af393553ad 100644 (file)
@@ -219,13 +219,13 @@ class Profile
                        return [];
                }
 
-               $a->profile_owner = $profile['uid'];
+               $a->setProfileOwner($profile['uid']);
 
                DI::page()['title'] = $profile['name'] . ' @ ' . DI::config()->get('config', 'sitename');
 
                if (!DI::pConfig()->get(local_user(), 'system', 'always_my_theme')) {
                        $a->setCurrentTheme($profile['theme']);
-                       $a->setCurrentMobileTheme(DI::pConfig()->get($a->profile_owner, 'system', 'mobile_theme'));
+                       $a->setCurrentMobileTheme(DI::pConfig()->get($a->getProfileOwner(), 'system', 'mobile_theme'));
                }
 
                /*
@@ -361,6 +361,7 @@ class Profile
                $homepage = !empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false;
                $about    = !empty($profile['about'])    ? DI::l10n()->t('About:')    : false;
                $xmpp     = !empty($profile['xmpp'])     ? DI::l10n()->t('XMPP:')     : false;
+               $matrix   = !empty($profile['matrix'])   ? DI::l10n()->t('Matrix:')   : false;
 
                if ((!empty($profile['hidewall']) || $block) && !Session::isAuthenticated()) {
                        $location = $homepage = $about = false;
@@ -439,6 +440,7 @@ class Profile
                $o .= Renderer::replaceMacros($tpl, [
                        '$profile' => $p,
                        '$xmpp' => $xmpp,
+                       '$matrix' => $matrix,
                        '$follow' => DI::l10n()->t('Follow'),
                        '$follow_link' => $follow_link,
                        '$unfollow' => DI::l10n()->t('Unfollow'),
@@ -544,7 +546,7 @@ class Profile
 
                                        $rr['link'] = Contact::magicLinkById($rr['cid']);
                                        $rr['title'] = $rr['name'];
-                                       $rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
+                                       $rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $a->getTimeZone(), 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
                                        $rr['startime'] = null;
                                        $rr['today'] = $today;
                                }
@@ -603,8 +605,8 @@ class Profile
                                        $total++;
                                }
 
-                               $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', 'Y-m-d');
-                               if ($strt === DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) {
+                               $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC', 'UTC', 'Y-m-d');
+                               if ($strt === DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) {
                                        $istoday = true;
                                }
 
@@ -619,17 +621,17 @@ class Profile
                                        $description = DI::l10n()->t('[No description]');
                                }
 
-                               $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC');
+                               $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC');
 
-                               if (substr($strt, 0, 10) < DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) {
+                               if (substr($strt, 0, 10) < DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) {
                                        continue;
                                }
 
-                               $today = ((substr($strt, 0, 10) === DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d')) ? true : false);
+                               $today = ((substr($strt, 0, 10) === DateTimeFormat::timezoneNow($a->getTimeZone(), 'Y-m-d')) ? true : false);
 
                                $rr['title'] = $title;
                                $rr['description'] = $description;
-                               $rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
+                               $rr['date'] = DI::l10n()->getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->getTimeZone() : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
                                $rr['startime'] = $strt;
                                $rr['today'] = $today;
 
@@ -768,7 +770,7 @@ class Profile
 
                Session::setVisitorsContacts();
 
-               $a->contact_id = $visitor['id'];
+               $a->setContactId($visitor['id']);
 
                Logger::info('Authenticated visitor', ['url' => $visitor['url']]);
 
@@ -829,7 +831,7 @@ class Profile
                 */
                Hook::callAll('magic_auth_success', $arr);
 
-               $a->contact_id = $arr['visitor']['id'];
+               $a->setContactId($arr['visitor']['id']);
 
                info(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name']));
 
@@ -871,7 +873,7 @@ class Profile
         */
        public static function getThemeUid(App $a)
        {
-               $uid = !empty($a->profile_owner) ? intval($a->profile_owner) : 0;
+               $uid = !empty($a->getProfileOwner()) ? intval($a->getProfileOwner()) : 0;
                if (local_user() && (DI::pConfig()->get(local_user(), 'system', 'always_my_theme') || !$uid)) {
                        return local_user();
                }