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.
This commit is contained in:
parent
deb01a0ef7
commit
f849fcab14
@ -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? {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user