]> git.mxchange.org Git - friendica.git/blobdiff - src/Factory/Notification/Notification.php
Add new paradigm classes for notify
[friendica.git] / src / Factory / Notification / Notification.php
index ce251109f9aa482d13c0b83092f5a5eba876320c..9f833130aaae81611121fe84f702d63fc962fa64 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -32,6 +32,7 @@ use Friendica\Core\PConfig\IPConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\Session\ISession;
 use Friendica\Database\Database;
+use Friendica\Model\Contact;
 use Friendica\Model\Post;
 use Friendica\Module\BaseNotifications;
 use Friendica\Network\HTTPException\InternalServerErrorException;
@@ -62,8 +63,6 @@ class Notification extends BaseFactory
        private $baseUrl;
        /** @var L10n */
        private $l10n;
-       /** @var string */
-       private $nurl;
 
        public function __construct(LoggerInterface $logger, Database $dba, Repository\Notification $notification, BaseURL $baseUrl, L10n $l10n, App $app, IPConfig $pConfig, ISession $session)
        {
@@ -73,7 +72,6 @@ class Notification extends BaseFactory
                $this->notification = $notification;
                $this->baseUrl      = $baseUrl;
                $this->l10n         = $l10n;
-               $this->nurl         = $app->contact['nurl'] ?? '';
        }
 
        /**
@@ -239,7 +237,7 @@ class Notification extends BaseFactory
                                $formattedNotifications[] = new \Friendica\Object\Notification\Notification([
                                        'label' => 'notification',
                                        'link'  => $this->baseUrl->get(true) . '/notification/' . $notification->id,
-                                       'image' => Proxy::proxifyUrl($notification->photo, false, Proxy::SIZE_MICRO),
+                                       'image' => Contact::getAvatarUrlForUrl($notification->url, $notification->uid, Proxy::SIZE_MICRO),
                                        'url'   => $notification->url,
                                        'text'  => strip_tags(BBCode::convert($notification->msg)),
                                        'when'  => DateTimeFormat::local($notification->date, 'r'),