Parse channel search string to allow more powerful queries
I use the channel switcher with Ctrl+K a lot. Recently I joined two groups that have some overlapping members:
Group X has members aa, bb, me. Group Y has members aa, cc, me.
Now, it is quite tedious to search for them efficiently. If I search for "bb" and "cc" I will hit direct messaging with either of the two. And if I search for "aa" it is even worse: I get the two groups, plus direct messaging.
I suggest to allow for a search expressions as follows: "a b", "a c". I expect this to find group channels where there is a member whose name contains the latter "a" and a member whose name contains the letter "b" (or "c" respectively).
As far as I see, your current logic for matching channels is just plain substring inclusion. My suggestion would change this to first splitting by whitespace and then checking for inclusion of all tokens.
Also take some inspiration from fzf: https://github.com/junegunn/fzf#search-syntax with an implementation at https://github.com/junegunn/fzf/blob/master/src/pattern.go