]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Profile.php
Merge pull request #10632 from annando/fox-notifications
[friendica.git] / src / Module / Profile / Profile.php
index 4f083db2606c855cf9bdcfa9647b932c5665e88d..25b6eccc9abdb6c6514239985483420b19b6e43c 100644 (file)
@@ -26,7 +26,6 @@ use Friendica\Content\ForumManager;
 use Friendica\Content\Nav;
 use Friendica\Content\Text\BBCode;
 use Friendica\Content\Text\HTML;
-use Friendica\Content\Widget;
 use Friendica\Core\Hook;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
@@ -52,12 +51,13 @@ class Profile extends BaseProfile
                if (ActivityPub::isRequest()) {
                        $user = DBA::selectFirst('user', ['uid'], ['nickname' => $parameters['nickname']]);
                        if (DBA::isResult($user)) {
-                               // The function returns an empty array when the account is removed, expired or blocked
-                               $data = ActivityPub\Transmitter::getProfile($user['uid']);
-                               if (!empty($data)) {
+                               try {
+                                       $data = ActivityPub\Transmitter::getProfile($user['uid']);
                                        header('Access-Control-Allow-Origin: *');
                                        header('Cache-Control: max-age=23200, stale-while-revalidate=23200');
                                        System::jsonExit($data, 'application/activity+json');
+                               } catch (HTTPException\NotFoundException $e) {
+                                       System::jsonError(404, ['error' => 'Record not found']);
                                }
                        }
 
@@ -103,7 +103,7 @@ class Profile extends BaseProfile
                Nav::setSelected('home');
 
                $is_owner = local_user() == $profile['uid'];
-               $o = self::getTabsHTML($a, 'profile', $is_owner, $profile);
+               $o = self::getTabsHTML($a, 'profile', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
                if (!empty($profile['hidewall']) && !$is_owner && !$remote_contact_id) {
                        notice(DI::l10n()->t('Access to this profile has been restricted.'));
@@ -176,6 +176,10 @@ class Profile extends BaseProfile
                        $basic_fields += self::buildField('xmpp', DI::l10n()->t('XMPP:'), $profile['xmpp']);
                }
 
+               if ($profile['matrix']) {
+                       $basic_fields += self::buildField('matrix', DI::l10n()->t('Matrix:'), $profile['matrix']);
+               }
+
                if ($profile['homepage']) {
                        $basic_fields += self::buildField('homepage', DI::l10n()->t('Homepage:'), HTML::toLink($profile['homepage']));
                }