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.
26 lines
636 B
26 lines
636 B
package events |
|
|
|
// NameChangeEvent is received when a user changes their chat display name. |
|
type NameChangeEvent struct { |
|
Event |
|
UserEvent |
|
NewName string `json:"newName"` |
|
} |
|
|
|
// NameChangeBroadcast represents a user changing their chat display name. |
|
type NameChangeBroadcast struct { |
|
Event |
|
UserEvent |
|
Oldname string `json:"oldName"` |
|
} |
|
|
|
// GetBroadcastPayload will return the object to send to all chat users. |
|
func (e *NameChangeBroadcast) GetBroadcastPayload() EventPayload { |
|
return EventPayload{ |
|
"id": e.ID, |
|
"timestamp": e.Timestamp, |
|
"user": e.User, |
|
"oldName": e.Oldname, |
|
"type": UserNameChanged, |
|
} |
|
}
|
|
|