| author | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-03-26 19:13:34 UTC |
| committer | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-03-26 19:13:34 UTC |
| parent | 50e4aa1672859d22749ff4a601178030c03fe4e7 |
| snikket/Chat.hx | +10 | -1 |
diff --git a/snikket/Chat.hx b/snikket/Chat.hx index 6110091..bab0897 100644 --- a/snikket/Chat.hx +++ b/snikket/Chat.hx @@ -465,7 +465,16 @@ abstract class Chat { The display name of this Chat **/ public function getDisplayName() { - return this.displayName == chatId && chatId == client.accountId() ? client.displayName() : this.displayName; + final fn = this.displayName == chatId && chatId == client.accountId() ? client.displayName() : this.displayName; + final participants = getParticipants(); + if (fn == chatId && participants.length > 2 && participants.length < 20) { + return participants.map(id -> { + final p = getParticipantDetails(id); + p.isSelf ? null : p.displayName; + }).filter(fn -> fn != null).join(", "); + } else { + return fn; + } } @:allow(snikket)