MM-48614: saves priority for drafts (#21752)
* MM-48614: saves priority for drafts Adds a new column in the drafts table, "priority". This way we can save post's priority in the draft. Fixes OmitConnectionId, which when you published a ws event for a user was getting bypassed. Fixes Get for drafts returns deleted ones as well, which is needed for upsert. * Adds test case for the OmitConnectionId * Addresses review comments, removes DeleteAt * Vets * Adds missing translation * Re-instates DeleteAt column * Adds separate case to get draft including deleted * Fixes Update Draft * Empty
Этот коммит содержится в:
@@ -753,15 +753,15 @@ func (wc *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool {
|
||||
return wc.GetConnectionID() == msg.GetBroadcast().ConnectionId
|
||||
}
|
||||
|
||||
if wc.GetConnectionID() == msg.GetBroadcast().OmitConnectionId {
|
||||
return false
|
||||
}
|
||||
|
||||
// If the event is destined to a specific user
|
||||
if msg.GetBroadcast().UserId != "" {
|
||||
return wc.UserId == msg.GetBroadcast().UserId
|
||||
}
|
||||
|
||||
if wc.GetConnectionID() == msg.GetBroadcast().OmitConnectionId {
|
||||
return false
|
||||
}
|
||||
|
||||
// if the user is omitted don't send the message
|
||||
if len(msg.GetBroadcast().OmitUsers) > 0 {
|
||||
if _, ok := msg.GetBroadcast().OmitUsers[wc.UserId]; ok {
|
||||
|
||||
Ссылка в новой задаче
Block a user