]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Move notification to the new paradigm
[friendica.git] / include / api.php
index 52f04d954d0a90db783a8feac4b817266d1971eb..11950f52f3cbf4d3a20cc05f2f4af1d77e8fc0c4 100644 (file)
@@ -2193,11 +2193,14 @@ function api_statuses_mentions($type)
                (SELECT `uri-id` FROM `post-user-notification` WHERE `uid` = ? AND `notification-type` & ? != 0 ORDER BY `uri-id`)
                AND (`uid` = 0 OR (`uid` = ? AND NOT `global`)) AND `id` > ?";
 
-       $condition = [GRAVITY_PARENT, GRAVITY_COMMENT, api_user(),
-               Post\UserNotification::NOTIF_EXPLICIT_TAGGED | Post\UserNotification::NOTIF_IMPLICIT_TAGGED |
-               Post\UserNotification::NOTIF_THREAD_COMMENT | Post\UserNotification::NOTIF_DIRECT_COMMENT |
-               Post\UserNotification::NOTIF_DIRECT_THREAD_COMMENT,
-               api_user(), $since_id];
+       $condition = [
+               GRAVITY_PARENT, GRAVITY_COMMENT,
+               api_user(),
+               Post\UserNotification::TYPE_EXPLICIT_TAGGED | Post\UserNotification::TYPE_IMPLICIT_TAGGED |
+               Post\UserNotification::TYPE_THREAD_COMMENT | Post\UserNotification::TYPE_DIRECT_COMMENT |
+               Post\UserNotification::TYPE_DIRECT_THREAD_COMMENT,
+               api_user(), $since_id,
+       ];
 
        if ($max_id > 0) {
                $query .= " AND `id` <= ?";
@@ -5644,7 +5647,7 @@ function api_friendica_notification_seen($type)
                }
 
                if ($Notify->uriId) {
-                       DI::dba()->update('notification', ['seen' => true], ['uid' => $Notify->uid, 'target-uri-id' => $Notify->uriId]);
+                       DI::notification()->setAllSeenForUser($Notify->uid, ['target-uri-id' => $Notify->uriId]);
                }
 
                $Notify->setSeen();