Add channel to new item message
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
449e6321c6
commit
b3ecad3c92
|
@ -641,9 +641,14 @@ func (b *memoryBackend) channelAddItem(channel string, item microsub.Item) error
|
||||||
timelineBackend := b.getTimeline(channel)
|
timelineBackend := b.getTimeline(channel)
|
||||||
added, err := timelineBackend.AddItem(item)
|
added, err := timelineBackend.AddItem(item)
|
||||||
|
|
||||||
|
type newItemMessage struct {
|
||||||
|
Item microsub.Item
|
||||||
|
Channel string
|
||||||
|
}
|
||||||
|
|
||||||
// Sent message to Server-Sent-Events
|
// Sent message to Server-Sent-Events
|
||||||
if added {
|
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
|
return err
|
||||||
|
|
Loading…
Reference in New Issue
Block a user