MM-57326: [Shared Channels] Message priority, acknowledgement and persistent notifications need to be synced (#30736)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fa1c77d9b0
Коммит
85391de22a
@@ -6,9 +6,11 @@ package model
|
||||
import "net/http"
|
||||
|
||||
type PostAcknowledgement struct {
|
||||
UserId string `json:"user_id"`
|
||||
PostId string `json:"post_id"`
|
||||
AcknowledgedAt int64 `json:"acknowledged_at"`
|
||||
UserId string `json:"user_id"`
|
||||
PostId string `json:"post_id"`
|
||||
AcknowledgedAt int64 `json:"acknowledged_at"`
|
||||
ChannelId string `json:"channel_id"`
|
||||
RemoteId *string `json:"remote_id,omitempty"`
|
||||
}
|
||||
|
||||
func (o *PostAcknowledgement) IsValid() *AppError {
|
||||
@@ -20,5 +22,22 @@ func (o *PostAcknowledgement) IsValid() *AppError {
|
||||
return NewAppError("PostAcknowledgement.IsValid", "model.acknowledgement.is_valid.post_id.app_error", nil, "post_id="+o.PostId, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if !IsValidId(o.ChannelId) {
|
||||
return NewAppError("PostAcknowledgement.IsValid", "model.acknowledgement.is_valid.channel_id.app_error", nil, "channel_id="+o.ChannelId, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *PostAcknowledgement) GetRemoteID() string {
|
||||
if o.RemoteId != nil {
|
||||
return *o.RemoteId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (o *PostAcknowledgement) PreSave() {
|
||||
if o.AcknowledgedAt == 0 {
|
||||
o.AcknowledgedAt = GetMillis()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,6 +291,7 @@ type SyncMsg struct {
|
||||
Reactions []*Reaction `json:"reactions,omitempty"`
|
||||
Statuses []*Status `json:"statuses,omitempty"`
|
||||
MembershipChanges []*MembershipChangeMsg `json:"membership_changes,omitempty"`
|
||||
Acknowledgements []*PostAcknowledgement `json:"acknowledgements,omitempty"`
|
||||
}
|
||||
|
||||
func NewSyncMsg(channelID string) *SyncMsg {
|
||||
@@ -328,6 +329,9 @@ type SyncResponse struct {
|
||||
ReactionsLastUpdateAt int64 `json:"reactions_last_update_at"`
|
||||
ReactionErrors []string `json:"reaction_errors"`
|
||||
|
||||
AcknowledgementsLastUpdateAt int64 `json:"acknowledgements_last_update_at"`
|
||||
AcknowledgementErrors []string `json:"acknowledgement_errors"`
|
||||
|
||||
StatusErrors []string `json:"status_errors"` // user IDs for which the status sync failed
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user