fetchResults :: TeamId
             -> [ChannelId]
             -- ^ The channels to exclude from the results
             -> ChannelSearchScope
             -- ^ The scope to search
             -> Session
             -- ^ The connection session
             -> Text
             -- ^ The search string
             -> IO (Vec.Vector Channel)
fetchResults myTId exclude AllChannels session searchString = do
    resultChans <- case T.null searchString of
        True -> MM.mmGetPublicChannels myTId (Just 0) (Just 200) session
        False -> MM.mmSearchChannels myTId searchString session
    let filteredChans = Seq.filter (\ c -> not (channelId c `elem` exclude)) resultChans
        sortedChans = Vec.fromList $ toList $ Seq.sortBy (compare `on` channelDisplayName) filteredChans
    return sortedChans

-- | Move the selection up in the channel list overlay by one channel.
fetchResults :: TeamId
             -> [ChannelId]
             -- ^ The channels to exclude from the results
             -> ChannelSearchScope
             -- ^ The scope to search
             -> Session
             -- ^ The connection session
             -> Text
             -- ^ The search string
             -> IO (Vec.Vector Channel)
fetchResults myTId exclude AllChannels session searchString = do
    resultChans <- case T.null searchString of
        True -> MM.mmGetPublicChannels myTId (Just 0) (Just 200) session
        False -> MM.mmSearchChannels myTId searchString session
    let filteredChans = Seq.filter (\ c -> not (channelId c `elem` exclude)) resultChans
        sortedChans = Vec.fromList $ toList $ Seq.sortBy (compare `on` channelDisplayName) filteredChans
    return sortedChans

-- | Move the selection up in the channel list overlay by one channel.
fetchResults myTId exclude AllChannels session searchString = do
    resultChans <- case T.null searchString of
        True -> MM.mmGetPublicChannels myTId (Just 0) (Just 200) session
        False -> MM.mmSearchChannels myTId searchString session
    let filteredChans = Seq.filter (\ c -> not (channelId c `elem` exclude)) resultChans
        sortedChans = Vec.fromList $ toList $ Seq.sortBy (compare `on` channelDisplayName) filteredChans
    return sortedChans

-- | Move the selection up in the channel list overlay by one channel.