$this->logger->info('Parent post not found', ['uri-id' => $Notification->parentUriId]);
return $message;
}
- if ($Notification->type == Post\UserNotification::TYPE_COMMENT_PARTICIPATION) {
- $link_item = Post::selectFirst(['guid'], ['uri-id' => $Notification->targetUriId, 'uid' => [0, $Notification->uid]], ['order' => ['uid' => true]]);
- }
+ $link_item = Post::selectFirstPost(['guid'], ['uri-id' => $Notification->targetUriId]);
} else {
$item = Post::selectFirst([], ['uri-id' => $Notification->targetUriId, 'uid' => [0, $Notification->uid]], ['order' => ['uid' => true]]);
if (empty($item)) {
return $message;
}
}
+ $link_item = $item;
}
if (in_array($Notification->type, [Post\UserNotification::TYPE_COMMENT_PARTICIPATION, Post\UserNotification::TYPE_ACTIVITY_PARTICIPATION, Post\UserNotification::TYPE_SHARED])) {
}
}
- $link = $this->baseUrl . '/display/' . urlencode($link_item['guid'] ?? $item['guid']);
+ $link = $this->baseUrl . '/display/' . urlencode($link_item['guid']);
$content = Plaintext::getPost($item, 70);
if (!empty($content['text'])) {
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Database\Database;
use Friendica\Database\DBA;
+use Friendica\Model\Post\UserNotification;
use Friendica\Model\Verb;
use Friendica\Navigation\Notifications\Collection;
use Friendica\Navigation\Notifications\Entity;
*/
public function selectDigestForUser(int $uid): Collection\Notifications
{
- $values = [$uid];
+ $values = [$uid, Verb::getID(\Friendica\Protocol\Activity::ANNOUNCE),
+ UserNotification::TYPE_COMMENT_PARTICIPATION, UserNotification::TYPE_ACTIVITY_PARTICIPATION, UserNotification::TYPE_THREAD_COMMENT];
$like_condition = '';
if (!$this->pconfig->get($uid, 'system', 'notify_like')) {
$rows = $this->db->p("
SELECT notification.*
FROM notification
- WHERE id IN (
+ WHERE `id` IN (
SELECT MAX(`id`)
- FROM notification
- WHERE uid = ?
+ FROM `notification`
+ WHERE `uid` = ? AND NOT (`vid` = ? AND `type` IN (?, ?, ?))
$like_condition
$announce_condition
GROUP BY IFNULL(`parent-uri-id`, `actor-id`)