aboutsummaryrefslogtreecommitdiff
path: root/hotline/transaction_handlers.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-11-07 13:26:03 -0800
committerGitHub <noreply@github.com>2022-11-07 13:26:03 -0800
commit623eecee59af710eaae93033b9ff4c419d9d4cba (patch)
tree980d2fe55cf92ce8d16fc49bd6d10167d1d32930 /hotline/transaction_handlers.go
parent5a3f2adada6094ab99ca9a612c327730be2b0040 (diff)
parent361928c9ad8945d525534e3d7178755f49ff6c1f (diff)
Merge pull request #73 from jhalter/improve_frogblast_client_compat
Improve Frogblast client compatibility
Diffstat (limited to 'hotline/transaction_handlers.go')
-rw-r--r--hotline/transaction_handlers.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go
index 5a9ea5e..6816456 100644
--- a/hotline/transaction_handlers.go
+++ b/hotline/transaction_handlers.go
@@ -253,9 +253,10 @@ func HandleChatSend(cc *ClientConn, t *Transaction) (res []Transaction, err erro
formattedMsg = fmt.Sprintf("\r*** %s %s", cc.UserName, t.GetField(fieldData).Data)
}
+ // The ChatID field is used to identify messages as belonging to a private chat.
+ // All clients *except* Frogblast omit this field for public chat, but Frogblast sends a value of 00 00 00 00.
chatID := t.GetField(fieldChatID).Data
- // a non-nil chatID indicates the message belongs to a private chat
- if chatID != nil {
+ if chatID != nil && !bytes.Equal([]byte{0, 0, 0, 0}, chatID) {
chatInt := binary.BigEndian.Uint32(chatID)
privChat := cc.Server.PrivateChats[chatInt]