mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-24 13:43:12 +02:00
Restricted scope of board-category change WS event to correct user (#3594)
This commit is contained in:
parent
3b099bada4
commit
08c66fbeed
@ -486,8 +486,8 @@ func (pa *PluginAdapter) BroadcastCategoryChange(category model.Category) {
|
||||
|
||||
go func() {
|
||||
clusterMessage := &ClusterMessage{
|
||||
Payload: payload,
|
||||
EnsureUsers: []string{category.UserID},
|
||||
Payload: payload,
|
||||
UserID: category.UserID,
|
||||
}
|
||||
|
||||
pa.sendMessageToCluster("websocket_message", clusterMessage)
|
||||
@ -511,7 +511,18 @@ func (pa *PluginAdapter) BroadcastCategoryBoardChange(teamID, userID string, boa
|
||||
BoardCategories: &boardCategory,
|
||||
}
|
||||
|
||||
pa.sendTeamMessage(websocketActionUpdateCategoryBoard, teamID, utils.StructToMap(message))
|
||||
payload := utils.StructToMap(message)
|
||||
|
||||
go func() {
|
||||
clusterMessage := &ClusterMessage{
|
||||
Payload: payload,
|
||||
UserID: userID,
|
||||
}
|
||||
|
||||
pa.sendMessageToCluster("websocket_message", clusterMessage)
|
||||
}()
|
||||
|
||||
pa.sendUserMessageSkipCluster(websocketActionUpdateCategoryBoard, utils.StructToMap(message), userID)
|
||||
}
|
||||
|
||||
func (pa *PluginAdapter) BroadcastBlockDelete(teamID, blockID, boardID string) {
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
type ClusterMessage struct {
|
||||
TeamID string
|
||||
BoardID string
|
||||
UserID string
|
||||
Payload map[string]interface{}
|
||||
EnsureUsers []string
|
||||
}
|
||||
@ -69,5 +70,10 @@ func (pa *PluginAdapter) HandleClusterEvent(ev mmModel.PluginClusterEvent) {
|
||||
return
|
||||
}
|
||||
|
||||
if clusterMessage.UserID != "" {
|
||||
pa.sendUserMessageSkipCluster(action, clusterMessage.Payload, clusterMessage.UserID)
|
||||
return
|
||||
}
|
||||
|
||||
pa.sendTeamMessageSkipCluster(action, clusterMessage.TeamID, clusterMessage.Payload)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user