mirror of
https://github.com/modrinth/code.git
synced 2026-07-31 21:26:40 +00:00
fix(labrinth): include SharedInstanceInvite notifications for ws (#6603)
* fix(labrinth): include SharedInstanceInvite notifications for ws * chore: fmt
This commit is contained in:
@@ -130,23 +130,25 @@ pub async fn ws_init(
|
||||
)?)
|
||||
.await;
|
||||
|
||||
let unread_server_invites = DBNotification::get_many_user_exposed_on_site(
|
||||
user_id.into(),
|
||||
&**pool,
|
||||
&redis,
|
||||
)
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter(|notification| {
|
||||
!notification.read
|
||||
&& matches!(
|
||||
¬ification.body,
|
||||
NotificationBody::ServerInvite { .. }
|
||||
)
|
||||
})
|
||||
.map(Notification::from);
|
||||
let unread_launcher_invites =
|
||||
DBNotification::get_many_user_exposed_on_site(
|
||||
user_id.into(),
|
||||
&**pool,
|
||||
&redis,
|
||||
)
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter(|notification| {
|
||||
!notification.read
|
||||
&& matches!(
|
||||
¬ification.body,
|
||||
NotificationBody::ServerInvite { .. }
|
||||
| NotificationBody::SharedInstanceInvite { .. }
|
||||
)
|
||||
})
|
||||
.map(Notification::from);
|
||||
|
||||
for notification in unread_server_invites {
|
||||
for notification in unread_launcher_invites {
|
||||
let _ = session.text(serde_json::to_string(¬ification)?).await;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user