'Return \'limit\'-first channels\' id, name and public fields such that the name matches a
\'search\' string. Exclude channels of type chat (DM), and private channels the current
user isn\'t registered to.'

@api.model
def get_mention_suggestions(self, search, limit=8):

    domain = expression.AND([[('name', 'ilike', search)], [('channel_type', '=', 'channel')], expression.OR([[('public', '!=', 'private')], [('channel_partner_ids', 'in', [self.env.user.partner_id.id])]])])
    return self.search_read(domain, ['id', 'name', 'public'], limit=limit)
