MM-56579: Include deactivated users from DM posts (#25985)

There were 2 separate bugs here:
1. We were not including deactivated users while fetching posts from
DM channels.
2. We were not respecting the includeArchivedChannels flag while
fetching DM channels.

We fix both of these issues here.

```release-note
Include posts from deactivated users in DM channel export. Also
respect the --include-archived-channels flag for DM channels.
```

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

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Agniva De Sarker
2024-02-14 20:59:46 +05:30
коммит произвёл GitHub
родитель 62f616dfbf
Коммит 28cb8d0441
9 изменённых файлов: 44 добавлений и 43 удалений

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

@@ -5610,10 +5610,10 @@ func (s *TimerLayerPostStore) Get(ctx context.Context, id string, opts model.Get
return result, err
}
func (s *TimerLayerPostStore) GetDirectPostParentsForExportAfter(limit int, afterID string) ([]*model.DirectPostForExport, error) {
func (s *TimerLayerPostStore) GetDirectPostParentsForExportAfter(limit int, afterID string, includeArchivedChannels bool) ([]*model.DirectPostForExport, error) {
start := time.Now()
result, err := s.PostStore.GetDirectPostParentsForExportAfter(limit, afterID)
result, err := s.PostStore.GetDirectPostParentsForExportAfter(limit, afterID, includeArchivedChannels)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {