2020-06-23 03:11:56 +02:00
|
|
|
package models
|
2020-05-24 02:57:49 +02:00
|
|
|
|
2020-06-23 03:11:56 +02:00
|
|
|
//ChatMessage represents a single chat message
|
2020-06-15 01:44:38 +02:00
|
|
|
type ChatMessage struct {
|
2020-06-23 22:11:01 +02:00
|
|
|
ClientID string `json:"-"`
|
|
|
|
|
2020-06-15 01:44:38 +02:00
|
|
|
Author string `json:"author"`
|
|
|
|
Body string `json:"body"`
|
|
|
|
Image string `json:"image"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
MessageType string `json:"type"`
|
2020-05-24 02:57:49 +02:00
|
|
|
}
|
|
|
|
|
2020-06-23 22:11:01 +02:00
|
|
|
//Valid checks to ensure the message is valid
|
|
|
|
func (s ChatMessage) Valid() bool {
|
|
|
|
return s.Author != "" && s.Body != "" && s.ID != ""
|
|
|
|
}
|