From b3ecad3c9205bf887f345e172860f2c8671d1d0f Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 18 Aug 2019 13:15:03 +0200 Subject: [PATCH] Add channel to new item message --- cmd/eksterd/memory.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/eksterd/memory.go b/cmd/eksterd/memory.go index a9a4165..06ae5d6 100644 --- a/cmd/eksterd/memory.go +++ b/cmd/eksterd/memory.go @@ -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