MM-34549 shared channels; add users to channel that were already sync'd (#17361)

Fixes a bug and adds a feature for shared channels:
- The Bug: when creating new shared channels, users that had already been sync'd via another channel were not added to the new channel's member list, since the users were not sync'd again. This PR sync's users per channel.
- The Feature: support custom statuses
Этот коммит содержится в:
Doug Lauder
2021-04-14 14:59:26 -04:00
коммит произвёл GitHub
родитель 81c40174e6
Коммит 9799fe9be6
19 изменённых файлов: 123 добавлений и 52 удалений

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

@@ -183,6 +183,7 @@ type SharedChannelRemoteStatus struct {
type SharedChannelUser struct {
Id string `json:"id"`
UserId string `json:"user_id"`
ChannelId string `json:"channel_id"`
RemoteId string `json:"remote_id"`
CreateAt int64 `json:"create_at"`
LastSyncAt int64 `json:"last_sync_at"`
@@ -202,6 +203,10 @@ func (scu *SharedChannelUser) IsValid() *AppError {
return NewAppError("SharedChannelUser.IsValid", "model.channel.is_valid.id.app_error", nil, "UserId="+scu.UserId, http.StatusBadRequest)
}
if !IsValidId(scu.ChannelId) {
return NewAppError("SharedChannelUser.IsValid", "model.channel.is_valid.id.app_error", nil, "ChannelId="+scu.ChannelId, http.StatusBadRequest)
}
if !IsValidId(scu.RemoteId) {
return NewAppError("SharedChannelUser.IsValid", "model.channel.is_valid.id.app_error", nil, "RemoteId="+scu.RemoteId, http.StatusBadRequest)
}