mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 21:26:50 +00:00
Use Result for last_notification_read as zero-default not appropriate.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
9c5caa3a5f
commit
1f0cfec5ca
3 files changed
+6
-4
No files matched your search
@@ -812,6 +812,7 @@ async fn load_joined_room(
|
||||
services
|
||||
.pusher
|
||||
.last_notification_read(sender_user, room_id)
|
||||
.ok()
|
||||
})
|
||||
.into();
|
||||
|
||||
@@ -872,8 +873,9 @@ async fn load_joined_room(
|
||||
.map(Into::into)
|
||||
});
|
||||
|
||||
let send_notification_counts =
|
||||
last_notification_read.is_none_or(|last_count| last_count.gt(&since));
|
||||
let send_notification_counts = last_notification_read
|
||||
.flatten()
|
||||
.is_none_or(|last_count| last_count.gt(&since));
|
||||
|
||||
let notification_count: OptionFuture<_> = send_notification_counts
|
||||
.then(|| {
|
||||
|
||||
@@ -102,6 +102,7 @@ async fn matcher(
|
||||
services
|
||||
.pusher
|
||||
.last_notification_read(sender_user, &room_id)
|
||||
.unwrap_or_default()
|
||||
})
|
||||
.into();
|
||||
|
||||
|
||||
Reference in new issue
Block a user