Split pusher service send/request into unit.

Refactor sender's push destination handler.

Combine remnants of service::rooms::user with pusher service.

Further split and reorg pusher service units.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-10-27 15:55:55 +00:00
parent 563873af77
commit 5e89f0acae
13 changed files with 565 additions and 589 deletions

View File

@@ -28,7 +28,7 @@ pub(crate) async fn set_read_marker_route(
if body.private_read_receipt.is_some() || body.read_receipt.is_some() {
services
.user
.pusher
.reset_notification_counts(sender_user, &body.room_id);
}
@@ -115,7 +115,7 @@ pub(crate) async fn create_receipt_route(
create_receipt::v3::ReceiptType::Read | create_receipt::v3::ReceiptType::ReadPrivate
) {
services
.user
.pusher
.reset_notification_counts(sender_user, &body.room_id);
}

View File

@@ -809,7 +809,7 @@ async fn load_joined_room(
.is_empty()
.then(|| {
services
.user
.pusher
.last_notification_read(sender_user, room_id)
})
.into();
@@ -877,7 +877,7 @@ async fn load_joined_room(
let notification_count: OptionFuture<_> = send_notification_counts
.then(|| {
services
.user
.pusher
.notification_count(sender_user, room_id)
.map(TryInto::try_into)
.unwrap_or(uint!(0))
@@ -887,7 +887,7 @@ async fn load_joined_room(
let highlight_count: OptionFuture<_> = send_notification_counts
.then(|| {
services
.user
.pusher
.highlight_count(sender_user, room_id)
.map(TryInto::try_into)
.unwrap_or(uint!(0))

View File

@@ -273,13 +273,13 @@ async fn handle_room(
.map(Option::flatten);
let highlight_count = services
.user
.pusher
.highlight_count(sender_user, room_id)
.map(TryInto::try_into)
.map(Result::ok);
let notification_count = services
.user
.pusher
.notification_count(sender_user, room_id)
.map(TryInto::try_into)
.map(Result::ok);
@@ -304,7 +304,7 @@ async fn handle_room(
.map(|is_dm| is_dm.then_some(is_dm));
let last_read_count = services
.user
.pusher
.last_notification_read(sender_user, room_id);
let timeline = timeline_pdus

View File

@@ -100,7 +100,7 @@ async fn matcher(
let last_notification: OptionFuture<_> = matched
.then(|| {
services
.user
.pusher
.last_notification_read(sender_user, &room_id)
})
.into();