Add channel to new item message
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2019-08-18 13:15:03 +02:00
parent 449e6321c6
commit b3ecad3c92
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -641,9 +641,14 @@ func (b *memoryBackend) channelAddItem(channel string, item microsub.Item) error
timelineBackend := b.getTimeline(channel)
added, err := timelineBackend.AddItem(item)
type newItemMessage struct {
Item microsub.Item
Channel string
}
// Sent message to Server-Sent-Events
if added {
b.broker.Notifier <- sse.Message{Event: "new item", Object: item}
b.broker.Notifier <- sse.Message{Event: "new item", Object: newItemMessage{item, channel}}
}
return err