MM-55524: Include deactivated users in DM export (#25695)

We were incorrectly excluding deactivated users
while getting channel members for a DM channel, whereas
we were actually exporting all users in the users array.

We fix this and also correctly honor the includeArchivedChannels
flag as well.

https://mattermost.atlassian.net/browse/MM-55524

```release-note
Include deactivated members in a favorited DM channel export.
```


---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Agniva De Sarker
2024-01-20 08:47:47 +05:30
коммит произвёл GitHub
родитель f7446d7443
Коммит 8364e30a2a
9 изменённых файлов: 49 добавлений и 42 удалений

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

@@ -1175,11 +1175,11 @@ func (s *RetryLayerChannelStore) GetAllChannelsForExportAfter(limit int, afterID
}
func (s *RetryLayerChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterID string) ([]*model.DirectChannelForExport, error) {
func (s *RetryLayerChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterID string, includeArchivedChannels bool) ([]*model.DirectChannelForExport, error) {
tries := 0
for {
result, err := s.ChannelStore.GetAllDirectChannelsForExportAfter(limit, afterID)
result, err := s.ChannelStore.GetAllDirectChannelsForExportAfter(limit, afterID, includeArchivedChannels)
if err == nil {
return result, nil
}