Files
owncast/core/chat/events/fediverseEngagementEvent.go
T
CopilotGitHubgabekcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
a0066fcf54 Fix all golangci-lint warnings surfaced by v2.4.0 (#4567)
* Initial plan

* Fix all golangci-lint warnings (21 issues resolved)

Co-authored-by: gabek <414923+gabek@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gabek <414923+gabek@users.noreply.github.com>
2025-09-25 20:03:40 -07:00

38 lines
991 B
Go

package events
import (
"github.com/owncast/owncast/persistence/configrepository"
)
// FediverseEngagementEvent is a message displayed in chat on representing an action on the Fediverse.
type FediverseEngagementEvent struct {
Event
MessageEvent
Image *string `json:"image"`
Link string `json:"link"`
UserAccountName string `json:"title"`
}
// GetBroadcastPayload will return the object to send to all chat users.
func (e *FediverseEngagementEvent) GetBroadcastPayload() EventPayload {
configRepository := configrepository.Get()
return EventPayload{
"id": e.ID,
"timestamp": e.Timestamp,
"body": e.Body,
"image": e.Image,
"type": e.Type,
"title": e.UserAccountName,
"link": e.Link,
"user": EventPayload{
"displayName": configRepository.GetServerName(),
},
}
}
// GetMessageType will return the event type for this message.
func (e *FediverseEngagementEvent) GetMessageType() EventType {
return e.Type
}