2021-11-03 04:00:15 +03:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|
2021-11-13 03:24:08 +03:00
|
|
|
|
|
|
|
// GetMessageType will return the event type for this message.
|
|
|
|
func (e *SetMessageVisibilityEvent) GetMessageType() EventType {
|
|
|
|
return VisibiltyUpdate
|
|
|
|
}
|