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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -100,7 +100,7 @@ async fn matcher(
|
||||
let last_notification: OptionFuture<_> = matched
|
||||
.then(|| {
|
||||
services
|
||||
.user
|
||||
.pusher
|
||||
.last_notification_read(sender_user, &room_id)
|
||||
})
|
||||
.into();
|
||||
|
||||
Reference in New Issue
Block a user