1
0
Fork 0
mirror of https://github.com/owncast/owncast.git synced 2024-12-27 03:28:30 +03:00
owncast/core/chat/events/setMessageVisibilityEvent.go

26 lines
688 B
Go

package events
// SetMessageVisibilityEvent is the event fired when one or more message
// visibilities are changed.
type SetMessageVisibilityEvent struct {
Event
UserMessageEvent
MessageIDs []string
Visible bool
}
// GetBroadcastPayload will return the object to send to all chat users.
func (e *SetMessageVisibilityEvent) GetBroadcastPayload() EventPayload {
return EventPayload{
"type": VisibiltyUpdate,
"id": e.ID,
"timestamp": e.Timestamp,
"ids": e.MessageIDs,
"visible": e.Visible,
}
}
// GetMessageType will return the event type for this message.
func (e *SetMessageVisibilityEvent) GetMessageType() EventType {
return VisibiltyUpdate
}