From 501de4f997c272d8b730fdb23643ccaf53db5dcc Mon Sep 17 00:00:00 2001 From: kosyak Date: Tue, 21 May 2024 16:50:59 +0200 Subject: [PATCH] fix last notification timestamp default value --- .../siacs/conversations/services/NotificationService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index b32e2cb6f..d8d959ee5 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -951,7 +951,11 @@ public class NotificationService { return false; } - long lastNotificationTimestamp = ensureLastNotificationTimeByConversation().getLong(conversation.getUuid(), 0L); + long lastNotificationTimestamp = ensureLastNotificationTimeByConversation().getLong(conversation.getUuid(), -1L); + + if (lastNotificationTimestamp <= 0L) { + return false; + } return (System.currentTimeMillis() - lastNotificationTimestamp) < throttlingPeriod; }