Private
Public Access
1
0

server: Implements sendMessage

This commit is contained in:
2023-06-23 00:44:25 -07:00
parent 06046ac266
commit 943f52ac45
4 changed files with 68 additions and 1 deletions

View File

@@ -1,6 +1,10 @@
package model
import "time"
import (
"time"
"github.com/rs/zerolog"
)
type Message struct {
Text string `json:"text"`
@@ -16,3 +20,15 @@ type AttributionInfo struct {
ThumbnailWidth int `json:"pgensw"`
ThumbnailHeight int `json:"pgensh"`
}
func (c Message) MarshalZerologObject(e *zerolog.Event) {
e.Str("guid", c.Guid)
e.Str("text", c.Text)
e.Time("date", c.Date)
if c.Sender != nil {
e.Str("sender", *c.Sender)
} else {
e.Str("sender", "(Me)")
}
}