From 5befc50a95080849cb23de611eca808b0a5f9203 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Mon, 3 Sep 2018 08:27:37 +0200 Subject: [PATCH] Subscribe user to the channel he just created --- sam/websocket/session_incoming_channel.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sam/websocket/session_incoming_channel.go b/sam/websocket/session_incoming_channel.go index 51c876e8c..4697d1bb6 100644 --- a/sam/websocket/session_incoming_channel.go +++ b/sam/websocket/session_incoming_channel.go @@ -64,6 +64,11 @@ func (s *Session) channelCreate(ctx context.Context, p *incoming.ChannelCreate) return err } + // Explicitly subscribe to newly created channel + s.subs.Add(uint64toa(ch.ID)) + + // @todo this should go over all user's sessons and subscribe there as well + pl := payloadFromChannel(ch) if ch.Type == types.ChannelTypePublic {