From ba7e453bde684e9c51879f240fe0e3e0cc6f8a19 Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Wed, 10 Aug 2022 08:17:36 -0600 Subject: [PATCH] GH-3621- Make query case insensitive (#3623) * make check case insensitive * Fixed a server lint Co-authored-by: Harshil Sharma --- .../services/store/mattermostauthlayer/mattermostauthlayer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/services/store/mattermostauthlayer/mattermostauthlayer.go b/server/services/store/mattermostauthlayer/mattermostauthlayer.go index 9664b37c1..52ad35152 100644 --- a/server/services/store/mattermostauthlayer/mattermostauthlayer.go +++ b/server/services/store/mattermostauthlayer/mattermostauthlayer.go @@ -826,13 +826,14 @@ func (s *MattermostAuthLayer) SearchUserChannels(teamID, userID, query string) ( if err != nil { return nil, err } + lowerQuery := strings.ToLower(query) result := []*mmModel.Channel{} count := 0 for _, channel := range channels { if channel.Type != mmModel.ChannelTypeDirect && channel.Type != mmModel.ChannelTypeGroup && - (strings.Contains(channel.Name, query) || strings.Contains(channel.DisplayName, query)) { + (strings.Contains(strings.ToLower(channel.Name), lowerQuery) || strings.Contains(strings.ToLower(channel.DisplayName), lowerQuery)) { result = append(result, channel) count++ if count >= 10 {