Unverified Commit 56bd30c6 authored by Mattermost Build's avatar Mattermost Build Committed by GitHub
Browse files

MM-27407 Return archived channels even if view archived config is false for...


MM-27407 Return archived channels even if view archived config is false for sysadmin endpoints (#15149) (#15182)
Co-authored-by: default avatarMattermod <mattermod@users.noreply.github.com>
(cherry picked from commit d4dac31b

)
Co-authored-by: default avatarFarhan Munshi <3207297+fmunshi@users.noreply.github.com>
parent f9a631da
......@@ -957,15 +957,6 @@ func TestGetAllChannels(t *testing.T) {
defer th.TearDown()
Client := th.Client
var originalConfigVal bool
th.App.UpdateConfig(func(cfg *model.Config) {
originalConfigVal = *cfg.TeamSettings.ExperimentalViewArchivedChannels
*cfg.TeamSettings.ExperimentalViewArchivedChannels = true
})
defer th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.TeamSettings.ExperimentalViewArchivedChannels = originalConfigVal
})
th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) {
channels, resp := client.GetAllChannels(0, 20, "")
CheckNoError(t, resp)
......@@ -1253,10 +1244,6 @@ func TestSearchAllChannels(t *testing.T) {
})
CheckNoError(t, groupErr)
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.TeamSettings.ExperimentalViewArchivedChannels = true
})
testCases := []struct {
Description string
Search *model.ChannelSearch
......
......@@ -1570,7 +1570,6 @@ func (a *App) GetChannelsForUser(teamId string, userId string, includeDeleted bo
}
func (a *App) GetAllChannels(page, perPage int, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError) {
opts.IncludeDeleted = *a.Config().TeamSettings.ExperimentalViewArchivedChannels && opts.IncludeDeleted
if opts.ExcludeDefaultChannels {
opts.ExcludeChannelNames = a.DefaultChannelNames()
}
......@@ -2187,7 +2186,6 @@ func (a *App) AutocompleteChannelsForSearch(teamId string, userId string, term s
// SearchAllChannels returns a list of channels, the total count of the results of the search (if the paginate search option is true), and an error.
func (a *App) SearchAllChannels(term string, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) {
opts.IncludeDeleted = *a.Config().TeamSettings.ExperimentalViewArchivedChannels && opts.IncludeDeleted
if opts.ExcludeDefaultChannels {
opts.ExcludeChannelNames = a.DefaultChannelNames()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment