Browse Source

Fix parameters in logout notification functions

pull/7047/head
qaz741wsd856 3 weeks ago
parent
commit
295a45462b
  1. 4
      src/api/notifications.rs
  2. 4
      src/api/push.rs

4
src/api/notifications.rs

@ -363,7 +363,7 @@ impl WebSocketUsers {
if *NOTIFICATIONS_DISABLED { if *NOTIFICATIONS_DISABLED {
return; return;
} }
let acting_device_id = device.map(|d| d.uuid.clone()); let acting_device_id = acting_device.map(|d| d.uuid.clone());
let data = create_update( let data = create_update(
vec![("UserId".into(), user.uuid.to_string().into()), ("Date".into(), serialize_date(user.updated_at))], vec![("UserId".into(), user.uuid.to_string().into()), ("Date".into(), serialize_date(user.updated_at))],
UpdateType::LogOut, UpdateType::LogOut,
@ -375,7 +375,7 @@ impl WebSocketUsers {
} }
if CONFIG.push_enabled() { if CONFIG.push_enabled() {
push_logout(user, device, conn).await; push_logout(user, acting_device, conn).await;
} }
} }

4
src/api/push.rs

@ -193,8 +193,8 @@ pub async fn push_logout(user: &User, acting_device: Option<&Device>, conn: &DbC
tokio::task::spawn(send_to_push_relay(json!({ tokio::task::spawn(send_to_push_relay(json!({
"userId": user.uuid, "userId": user.uuid,
"organizationId": (), "organizationId": (),
"deviceId": device.and_then(|d| d.push_uuid.as_ref()), "deviceId": acting_device.and_then(|d| d.push_uuid.as_ref()),
"identifier": device.map(|d| &d.uuid), "identifier": acting_device.map(|d| &d.uuid),
"type": UpdateType::LogOut as i32, "type": UpdateType::LogOut as i32,
"payload": { "payload": {
"userId": user.uuid, "userId": user.uuid,

Loading…
Cancel
Save