mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-23 19:06:35 +00:00
0c01b53b09
feat(messages): add trigram index for text content search - feat: UI animations for conversation and messages list. - Simplify websocket updates.
29 lines
765 B
Go
29 lines
765 B
Go
package models
|
|
|
|
// Action constants for WebSocket messages.
|
|
const (
|
|
MessageTypeMessagePropUpdate = "message_prop_update"
|
|
MessageTypeConversationPropertyUpdate = "conversation_prop_update"
|
|
MessageTypeNewMessage = "new_message"
|
|
MessageTypeNewConversation = "new_conversation"
|
|
MessageTypeError = "error"
|
|
)
|
|
|
|
// WSMessage represents a WS message.
|
|
type WSMessage struct {
|
|
MessageType int
|
|
Data []byte
|
|
}
|
|
|
|
// Message represents a WebSocket message to be sent.
|
|
type Message struct {
|
|
Type string `json:"type"`
|
|
Data interface{} `json:"data"`
|
|
}
|
|
|
|
// BroadcastMessage represents a message to be pushed to users.
|
|
type BroadcastMessage struct {
|
|
Data []byte `json:"data"`
|
|
Users []int `json:"users"`
|
|
}
|