[Firebase] Disable notifications for past shared events.

This commit is contained in:
Kuba Szczodrzyński 2022-03-14 17:08:35 +01:00
parent 48b7adb564
commit 2990fc5479
No known key found for this signature in database
GPG Key ID: 70CB8A85BA1633CB

View File

@ -164,7 +164,7 @@ class SzkolnyAppFirebase(val app: App, val profiles: List<Profile>, val message:
val type = if (event.isHomework) Notification.TYPE_NEW_SHARED_HOMEWORK else Notification.TYPE_NEW_SHARED_EVENT val type = if (event.isHomework) Notification.TYPE_NEW_SHARED_HOMEWORK else Notification.TYPE_NEW_SHARED_EVENT
val notificationFilter = app.config.getFor(event.profileId).sync.notificationFilter val notificationFilter = app.config.getFor(event.profileId).sync.notificationFilter
if (!notificationFilter.contains(type) && event.sharedBy != "self") { if (!notificationFilter.contains(type) && event.sharedBy != "self" && event.date >= Date.getToday()) {
val notification = Notification( val notification = Notification(
id = Notification.buildId(event.profileId, type, event.id), id = Notification.buildId(event.profileId, type, event.id),
title = app.getNotificationTitle(type), title = app.getNotificationTitle(type),