From 42cde4ea57b0154d48aecbb38351f72007d74b79 Mon Sep 17 00:00:00 2001 From: stealth658 <9551905+stealth658@users.noreply.github.com> Date: Tue, 20 Oct 2026 23:08:17 -0400 Subject: [PATCH] Decode incoming command 147 (SMS/RCS read on another device) When a forwarded SMS/RCS message is read on another of the account's devices, Apple sends command 147 on the SMS forwarding service with the read message's guid in "g". rustpush sends 147 but had no decoder for incoming ones, so the notice was dropped and the message stayed unread on the receiving client. Decode it as Message::Read with id = g. --- src/imessage/messages.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/imessage/messages.rs b/src/imessage/messages.rs index cf9420b..4a37c1c 100644 --- a/src/imessage/messages.rs +++ b/src/imessage/messages.rs @@ -2580,6 +2580,23 @@ impl MessageInst { return wrapper.to_message(None, Message::MarkUnread); } } + // A forwarded SMS/RCS message was read on another of the account's devices. + // Apple sends command 147 on the SMS forwarding service with the read + // message's guid in "g" (plus the read time in "e", and "fR" on some). + // rustpush sends 147 (MessageReadOnDevice) but had no decoder for incoming + // ones, so the notice was dropped and the message stayed unread. Deliver it + // as a Read for message "g". + if wrapper.command == 147 { + #[derive(Deserialize)] + struct RawSmsReadOnDevice { + g: String, + } + if let Ok(loaded) = plist::from_value::(&value) { + let mut msg = wrapper.to_message(None, Message::Read)?; + msg.id = loaded.g.to_uppercase(); + return Ok(msg); + } + } let shared_profile = if let Ok(loaded) = plist::from_value::(&value) { let shared_profile = ShareProfileMessage { cloud_kit_decryption_record_key: loaded.cloud_kit_decryption_record_key.clone().into(),