Changes the event to send when a channel is shared or unshared (#28183)
* Changes the event to send when a channel is shared or unshared Before we were sending the CHANNEL_CONVERTED websockets event, which is intended to notify of a public channel being converted into a private one, so the interface was showing the channel as private until the client was refreshed. Now a full channel update event is sent when the channel is shared or unshared, so the interface gets the new information correctly. * Fix message type on command tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cae456de2d
Коммит
d2c69fbf95
@@ -59,6 +59,9 @@ func (scs *Service) ShareChannel(sc *model.SharedChannel) (*model.SharedChannel,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// to avoid fetching the channel again, we manually set the shared
|
||||
// flag before notifying the clients
|
||||
channel.Shared = model.NewPointer(true)
|
||||
|
||||
scs.notifyClientsForSharedChannelConverted(channel)
|
||||
return scNew, nil
|
||||
@@ -93,6 +96,9 @@ func (scs *Service) UnshareChannel(channelID string) (bool, error) {
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
// to avoid fetching the channel again, we manually set the shared
|
||||
// flag before notifying the clients
|
||||
channel.Shared = model.NewPointer(false)
|
||||
|
||||
scs.notifyClientsForSharedChannelConverted(channel)
|
||||
return deleted, nil
|
||||
|
||||
Ссылка в новой задаче
Block a user