2024-06-27 14:38:18 +00:00
|
|
|
package models
|
|
|
|
|
2024-09-11 15:58:02 +00:00
|
|
|
import (
|
2024-11-02 05:40:37 +00:00
|
|
|
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
|
2024-09-11 15:58:02 +00:00
|
|
|
"gorm.io/datatypes"
|
|
|
|
)
|
2024-06-27 14:38:18 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
EventMessageNew = "messages.new"
|
|
|
|
EventMessageEdit = "messages.edit"
|
|
|
|
EventMessageDelete = "messages.delete"
|
|
|
|
EventSystemChanges = "system.changes"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Event struct {
|
2024-11-02 05:40:37 +00:00
|
|
|
cruda.BaseModel
|
2024-06-27 14:38:18 +00:00
|
|
|
|
|
|
|
Uuid string `json:"uuid"`
|
|
|
|
Body datatypes.JSONMap `json:"body"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Channel Channel `json:"channel"`
|
|
|
|
Sender ChannelMember `json:"sender"`
|
|
|
|
ChannelID uint `json:"channel_id"`
|
|
|
|
SenderID uint `json:"sender_id"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Event Payloads
|
|
|
|
|
|
|
|
type EventMessageBody struct {
|
2024-08-18 13:29:55 +00:00
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
Algorithm string `json:"algorithm,omitempty"`
|
|
|
|
Attachments []string `json:"attachments,omitempty"`
|
|
|
|
QuoteEvent uint `json:"quote_event,omitempty"`
|
|
|
|
RelatedEvent uint `json:"related_event,omitempty"`
|
|
|
|
RelatedUsers []uint `json:"related_users,omitempty"`
|
2024-06-27 14:38:18 +00:00
|
|
|
}
|