Re-add function for service messages

This commit is contained in:
Tulir Asokan 2022-04-15 23:31:48 +03:00
parent 66233721a2
commit ebe3fcc33c

View File

@ -41,6 +41,18 @@ func NewExpandedTextMessage(evt *muksevt.Event, displayname string, text tstring
}) })
} }
func NewServiceMessage(text string) *UIMessage {
return &UIMessage{
SenderID: "*",
SenderName: "*",
Timestamp: time.Now(),
IsService: true,
Renderer: &ExpandedTextMessage{
Text: tstring.NewTString(text),
},
}
}
func NewDateChangeMessage(text string) *UIMessage { func NewDateChangeMessage(text string) *UIMessage {
midnight := time.Now() midnight := time.Now()
midnight = time.Date(midnight.Year(), midnight.Month(), midnight.Day(), midnight = time.Date(midnight.Year(), midnight.Month(), midnight.Day(),