X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFactory%2FNotification%2FNotification.php;h=9f833130aaae81611121fe84f702d63fc962fa64;hb=1b4e3564a5b4e44bd2d4991bc36900753b819542;hp=ba36b0cef41cdfb54c28cecdb771d34a319d323f;hpb=122ad0af14f046c2462a03fe33967dc41abfc8b5;p=friendica.git diff --git a/src/Factory/Notification/Notification.php b/src/Factory/Notification/Notification.php index ba36b0cef4..9f833130aa 100644 --- a/src/Factory/Notification/Notification.php +++ b/src/Factory/Notification/Notification.php @@ -1,6 +1,6 @@ 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'), @@ -278,7 +276,7 @@ class Notification extends BaseFactory $formattedNotifications = []; try { - $items = Item::selectForUser(local_user(), $fields, $conditions, $params); + $items = Post::selectForUser(local_user(), $fields, $conditions, $params); while ($item = $this->dba->fetch($items)) { $formattedNotifications[] = $this->createFromItem($item); @@ -302,11 +300,7 @@ class Notification extends BaseFactory */ public function getPersonalList(bool $seen = false, int $start = 0, int $limit = BaseNotifications::DEFAULT_PAGE_LIMIT) { - $myUrl = str_replace('http://', '', $this->nurl); - $diaspUrl = str_replace('/profile/', '/u/', $myUrl); - - $condition = ["NOT `wall` AND `uid` = ? AND (`item`.`author-id` = ? OR `item`.`tag` REGEXP ? OR `item`.`tag` REGEXP ?)", - local_user(), public_contact(), $myUrl . '\\]', $diaspUrl . '\\]']; + $condition = ["NOT `wall` AND `uid` = ? AND `author-id` = ?", local_user(), public_contact()]; if (!$seen) { $condition[0] .= " AND `unseen`"; @@ -319,7 +313,7 @@ class Notification extends BaseFactory $formattedNotifications = []; try { - $items = Item::selectForUser(local_user(), $fields, $condition, $params); + $items = Post::selectForUser(local_user(), $fields, $condition, $params); while ($item = $this->dba->fetch($items)) { $formattedNotifications[] = $this->createFromItem($item); @@ -356,7 +350,7 @@ class Notification extends BaseFactory $formattedNotifications = []; try { - $items = Item::selectForUser(local_user(), $fields, $condition, $params); + $items = Post::selectForUser(local_user(), $fields, $condition, $params); while ($item = $this->dba->fetch($items)) { $item = $this->formatItem($item);