Files
libredesk/internal/ws/models/models.go
T
Abhinav Raut 0c01b53b09 feat(conversations): add trigram index for searching ref numbers
feat(messages): add trigram index for text content search
- feat: UI animations for conversation and messages list.
- Simplify websocket updates.
2025-01-19 23:10:53 +05:30

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"`
}