git » sdk » commit 5894524

If we are in a group text with a reply to, use the recipients as participants

author Stephen Paul Weber
2025-03-26 19:14:09 UTC
committer Stephen Paul Weber
2025-03-26 19:14:09 UTC
parent 407d7e633bdd9563dcd81cb651b70c392bad35a5

If we are in a group text with a reply to, use the recipients as participants

snikket/Chat.hx +6 -1

diff --git a/snikket/Chat.hx b/snikket/Chat.hx
index bab0897..dc75e76 100644
--- a/snikket/Chat.hx
+++ b/snikket/Chat.hx
@@ -722,7 +722,12 @@ class DirectChat extends Chat {
 
 	@HaxeCBridge.noemit // on superclass as abstract
 	public function getParticipants(): Array<String> {
-		return counterparts().concat([client.accountId()]);
+		final counters = counterparts();
+		if (counters.length < 2 && (lastMessage?.recipients?.length ?? 0) > 1) {
+			return lastMessage.recipients.map(r -> r.asString()).concat([lastMessage.senderId]);
+		} else {
+			return counterparts().concat([client.accountId()]);
+		}
 	}
 
 	private function counterparts() {