Added channel name to chat view

This commit is contained in:
tyler 2024-02-06 14:49:20 -05:00
parent 787078f720
commit bba51dfa18

21
chat.go
View file

@ -314,15 +314,16 @@ func startChatStream(ctx context.Context, event chan *sse.Event, handle func(cv
} }
type ChatView struct { type ChatView struct {
Badges []string Badges []string
Color string ChannelName string
ImageUrl string Color string
Init bool ImageUrl string
IsFollower bool Init bool
Rant int IsFollower bool
Text string Rant int
Type string Text string
Username string Type string
Username string
} }
func parseEvent(event []byte) ([]ChatView, error) { func parseEvent(event []byte) ([]ChatView, error) {
@ -397,7 +398,7 @@ func parseMessages(eventType string, messages []ChatEventMessage, users map[stri
} }
view.ImageUrl = channel.Image1 view.ImageUrl = channel.Image1
view.Username = channel.Username view.ChannelName = channel.Username
} }
views = append(views, view) views = append(views, view)