You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
600 B
25 lines
600 B
package events |
|
|
|
// UserMessageEvent is an inbound message from a user. |
|
type UserMessageEvent struct { |
|
Event |
|
UserEvent |
|
MessageEvent |
|
} |
|
|
|
// GetBroadcastPayload will return the object to send to all chat users. |
|
func (e *UserMessageEvent) GetBroadcastPayload() EventPayload { |
|
return EventPayload{ |
|
"id": e.ID, |
|
"timestamp": e.Timestamp, |
|
"body": e.Body, |
|
"user": e.User, |
|
"type": MessageSent, |
|
"visible": e.HiddenAt == nil, |
|
} |
|
} |
|
|
|
// GetMessageType will return the event type for this message. |
|
func (e *UserMessageEvent) GetMessageType() EventType { |
|
return MessageSent |
|
}
|
|
|