]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Deprecated the notify table/classes
[friendica.git] / mod / display.php
index b53dd354381b2266cea49cace30e3e9437db1342..da41c8656e9499d28fd26e8685b00dbfddac6379 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,7 +23,6 @@ use Friendica\App;
 use Friendica\Content\Text\BBCode;
 use Friendica\Content\Widget;
 use Friendica\Core\Logger;
-use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
 use Friendica\Database\DBA;
@@ -36,11 +35,12 @@ use Friendica\Module\ActivityPub\Objects;
 use Friendica\Network\HTTPException;
 use Friendica\Protocol\ActivityPub;
 use Friendica\Protocol\DFRN;
+use Friendica\Protocol\Diaspora;
 
 function display_init(App $a)
 {
        if (ActivityPub::isRequest()) {
-               Objects::rawContent(['guid' => DI::args()->getArgv()[1] ?? null]);
+               (new Objects(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER, ['guid' => DI::args()->getArgv()[1] ?? null]))->run();
        }
 
        if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
@@ -108,55 +108,23 @@ function display_init(App $a)
                $item = $parent ?: $item;
        }
 
-       $profiledata = display_fetchauthor($item);
-
-       DI::page()['aside'] = Widget\VCard::getHTML($profiledata);
+       DI::page()['aside'] = Widget\VCard::getHTML(display_fetchauthor($item));
 }
 
 function display_fetchauthor($item)
 {
-       $profiledata = Contact::getByURLForUser($item['author-link'], local_user());
-
-       // Check for a repeated message
-       $shared = Item::getShareArray($item);
-       if (!empty($shared) && empty($shared['comment'])) {
-               $profiledata = [
-                       'uid' => -1,
-                       'id' => -1,
-                       'nickname' => '',
-                       'name' => '',
-                       'picdate' => '',
-                       'photo' => '',
-                       'url' => '',
-                       'network' => '',
-               ];
-
-               if (!empty($shared['author'])) {
-                       $profiledata['name'] = $shared['author'];
-               }
-
+       if (Diaspora::isReshare($item['body'], true)) {
+               $shared = Item::getShareArray($item);
                if (!empty($shared['profile'])) {
-                       $profiledata['url'] = $shared['profile'];
-               }
-
-               if (!empty($shared['avatar'])) {
-                       $profiledata['photo'] = $shared['avatar'];
+                       $contact = Contact::getByURLForUser($shared['profile'], local_user());
                }
-
-               $profiledata['nickname'] = $profiledata['name'];
-               $profiledata['network'] = Protocol::matchByProfileUrl($profiledata['url']);
-
-               $profiledata['address'] = '';
-               $profiledata['about'] = '';
-
-               $profiledata = Contact::getByURLForUser($profiledata['url'], local_user()) ?: $profiledata;
        }
 
-       if (!empty($profiledata['photo'])) {
-               $profiledata['photo'] = DI::baseUrl()->remove($profiledata['photo']);
+       if (empty($contact)) {
+               $contact = Contact::getById($item['author-id']);
        }
 
-       return $profiledata;
+       return $contact;
 }
 
 function display_content(App $a, $update = false, $update_uid = 0)