Add event 'delete channel'
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2020-08-09 09:59:11 +02:00
parent 1144c615da
commit 330931742b
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -63,6 +63,11 @@ type channelMessage struct {
Channel microsub.Channel `json:"channel"`
}
type channelDeletedMessage struct {
Version int `json:"version"`
UID string `json:"uid"`
}
type newItemMessage struct {
Item microsub.Item `json:"item"`
Channel string `json:"channel"`
@ -262,6 +267,8 @@ func (b *memoryBackend) ChannelsDelete(uid string) error {
delete(b.Feeds, uid)
b.lock.Unlock()
b.broker.Notifier <- sse.Message{Event: "delete channel", Object: channelDeletedMessage{1, uid}}
return nil
}