mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-24 19:32:10 +00:00
4bab16c21a
- notifications for: mention', 'assignment', 'sla_warning', 'sla_breach' - new table `user_notifications` and migrations for the same.
30 lines
825 B
Go
30 lines
825 B
Go
package models
|
|
|
|
// Action constants for WebSocket messages.
|
|
const (
|
|
MessageTypeMessagePropUpdate = "message_prop_update"
|
|
MessageTypeConversationPropertyUpdate = "conversation_prop_update"
|
|
MessageTypeNewMessage = "new_message"
|
|
MessageTypeNewConversation = "new_conversation"
|
|
MessageTypeNewNotification = "new_notification"
|
|
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"`
|
|
}
|