From e83cc7357c39ce346af79721ee210dba01c67196 Mon Sep 17 00:00:00 2001 From: Martin Kraft Date: Thu, 28 May 2020 14:38:27 -0400 Subject: [PATCH] MM-24517: Add newly created channel admin role to all clients' redux state. (#14635) * MM-24517: Add newly created channel admin role to redux state. * MM-24517: Adds comment; fixes lint errors. --- app/channel.go | 8 ++++++++ model/client4.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/channel.go b/app/channel.go index 0474255803..8a4cf3e7f6 100644 --- a/app/channel.go +++ b/app/channel.go @@ -835,6 +835,14 @@ func (a *App) PatchChannelModerationsForChannel(channel *model.Channel, channelM return nil, err } + // Send a websocket event about this new role. The other new roles—member and guest—get emitted when they're updated. + var adminRole *model.Role + adminRole, err = a.GetRoleByName(scheme.DefaultChannelAdminRole) + if err != nil { + return nil, err + } + a.sendUpdatedRoleEvent(adminRole) + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_SCHEME_UPDATED, "", channel.Id, "", nil) a.Publish(message) mlog.Info("Permission scheme created.", mlog.String("channel_id", channel.Id), mlog.String("channel_name", channel.Name)) diff --git a/model/client4.go b/model/client4.go index db4875ee18..e41a9b8b4e 100644 --- a/model/client4.go +++ b/model/client4.go @@ -388,7 +388,7 @@ func (c *Client4) GetElasticsearchRoute() string { } func (c *Client4) GetBleveRoute() string { - return fmt.Sprintf("/bleve") + return "/bleve" } func (c *Client4) GetCommandsRoute() string {