Revert "MM-42810: Introduce a channel hook for a websocket event (#23812)" (#24107)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2023-07-24 21:46:57 +05:30
коммит произвёл GitHub
родитель e70abd6e0f
Коммит 29bd0c9357
8 изменённых файлов: 155 добавлений и 211 удалений

Просмотреть файл

@@ -761,17 +761,6 @@ func (wc *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool {
}
}
// The priority checks in order of specificity are:
// ConnectionId
// OmitConnectionId
//
// UserId
// OmitUserId
//
// ChannelId - is member of channel
// TeamId - is member of team
// Guest - does guest have access
// If the event is destined to a specific connection
if msg.GetBroadcast().ConnectionId != "" {
return wc.GetConnectionID() == msg.GetBroadcast().ConnectionId
@@ -800,16 +789,6 @@ func (wc *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool {
wc.lastAllChannelMembersTime = 0
}
// Execute channel hook
if msg.GetBroadcast().ChannelHook != nil {
hasChange := msg.GetBroadcast().ChannelHook(wc.UserId, msg)
if hasChange {
// If hook returns true, that means message has been modified. We need
// to wipe off the pre-computed JSON
msg.RemovePrecomputedJSON()
}
}
if wc.allChannelMembers == nil {
result, err := wc.Platform.Store.Channel().GetAllChannelMembersForUser(wc.UserId, false, false)
if err != nil {