From 0192243faaf65450c00091b10dd7783475599687 Mon Sep 17 00:00:00 2001 From: safetynotgauranteed Date: Fri, 6 Feb 2026 12:52:50 -0800 Subject: [PATCH 1/2] fix: isGroupHandle now correctly detects group chats The previous implementation preferred `identifier` over `guid` when checking for group chat prefixes. For group chats, `identifier` contains the bare GUID (e.g. `70012e07fc54...`) which never has the `;+;` prefix, while `guid` contains the prefixed form (e.g. `any;+;70012e07fc54...`). Since `identifier` is never empty (ChatInfo always populates it), the `guid` field was never checked, causing `is_group` to always return `false` for group chats in RPC output. Also removed the `;-;` check since that prefix indicates DMs, not groups. Fix: always check both `guid` and `identifier` for the `;+;` group prefix. --- Sources/imsg/RPCPayloads.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/imsg/RPCPayloads.swift b/Sources/imsg/RPCPayloads.swift index 415118f..de428c4 100644 --- a/Sources/imsg/RPCPayloads.swift +++ b/Sources/imsg/RPCPayloads.swift @@ -96,8 +96,7 @@ func reactionPayload(_ reaction: Reaction) -> [String: Any] { } func isGroupHandle(identifier: String, guid: String) -> Bool { - let handle = identifier.isEmpty ? guid : identifier - return handle.contains(";+;") || handle.contains(";-;") + return guid.contains(";+;") || identifier.contains(";+;") } func stringParam(_ value: Any?) -> String? { From bb23958a213d4618800b86c44bbf624fa3a53d49 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 16 Feb 2026 04:49:56 +0100 Subject: [PATCH 2/2] fix: align group-handle test expectation (#42) (thanks @shivshil) --- CHANGELOG.md | 1 + Tests/imsgTests/RPCPayloadsTests.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc4029..4a8f224 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - fix: apply history filters before limit (#20, thanks @tommybananas) - fix: flush watch output immediately when stdout is buffered (#43, thanks @ccaum) - feat: include `thread_originator_guid` in message output (#39, thanks @ruthmade) +- fix: detect groups from `;+;` prefix in guid/identifier for RPC payloads (#42, thanks @shivshil) ## 0.4.0 - 2026-01-07 - feat: surface audio message transcriptions (thanks @antons) diff --git a/Tests/imsgTests/RPCPayloadsTests.swift b/Tests/imsgTests/RPCPayloadsTests.swift index f290df6..f6da860 100644 --- a/Tests/imsgTests/RPCPayloadsTests.swift +++ b/Tests/imsgTests/RPCPayloadsTests.swift @@ -7,7 +7,7 @@ import Testing @Test func isGroupHandleFlagsGroup() { #expect(isGroupHandle(identifier: "iMessage;+;chat123", guid: "") == true) - #expect(isGroupHandle(identifier: "", guid: "iMessage;-;chat999") == true) + #expect(isGroupHandle(identifier: "", guid: "iMessage;-;chat999") == false) #expect(isGroupHandle(identifier: "+1555", guid: "") == false) }