Add the notify type to the notification query

This commit is contained in:
Michael 2022-06-05 15:02:03 +00:00
parent 13e216032f
commit d242332aa4
4 changed files with 8 additions and 8 deletions

View file

@ -117,7 +117,7 @@ class Notification extends BaseRepository
*/
public function selectDetailedForUser(int $uid): Collection\Notifications
{
$condition = [];
$condition = ["`type` & ? != 0", $this->pconfig->get($uid, 'system', 'notify_type', 3 | 72 | 4 | 16 | 32) | 128 | 256];
if (!$this->pconfig->get($uid, 'system', 'notify_like')) {
$condition = DBA::mergeConditions($condition, ['`vid` != ?', Verb::getID(\Friendica\Protocol\Activity::LIKE)]);
}
@ -138,7 +138,7 @@ class Notification extends BaseRepository
*/
public function selectDigestForUser(int $uid): Collection\Notifications
{
$values = [$uid];
$values = [$uid, $this->pconfig->get($uid, 'system', 'notify_type', 3 | 72 | 4 | 16 | 32) | 128 | 256];
$like_condition = '';
if (!$this->pconfig->get($uid, 'system', 'notify_like')) {
@ -158,7 +158,7 @@ class Notification extends BaseRepository
WHERE `id` IN (
SELECT MAX(`id`)
FROM `notification`
WHERE `uid` = ?
WHERE `uid` = ? AND `type` & ? != 0
$like_condition
$announce_condition
GROUP BY IFNULL(`parent-uri-id`, `actor-id`)