diff --git a/src/api/notifications.rs b/src/api/notifications.rs index fb82d3c9..492fdb19 100644 --- a/src/api/notifications.rs +++ b/src/api/notifications.rs @@ -363,7 +363,7 @@ impl WebSocketUsers { if *NOTIFICATIONS_DISABLED { 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( vec![("UserId".into(), user.uuid.to_string().into()), ("Date".into(), serialize_date(user.updated_at))], UpdateType::LogOut, @@ -375,7 +375,7 @@ impl WebSocketUsers { } if CONFIG.push_enabled() { - push_logout(user, device, conn).await; + push_logout(user, acting_device, conn).await; } } diff --git a/src/api/push.rs b/src/api/push.rs index 27358bea..5000869d 100644 --- a/src/api/push.rs +++ b/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!({ "userId": user.uuid, "organizationId": (), - "deviceId": device.and_then(|d| d.push_uuid.as_ref()), - "identifier": device.map(|d| &d.uuid), + "deviceId": acting_device.and_then(|d| d.push_uuid.as_ref()), + "identifier": acting_device.map(|d| &d.uuid), "type": UpdateType::LogOut as i32, "payload": { "userId": user.uuid,