'Get the informations header for the current channels
:returns a list of channels values
:rtype : list(dict)'

@api.multi
def channel_info(self, extra_info=False):

    channel_infos = []
    partner_channels = self.env['mail.channel.partner']
    if (self.env.user and self.env.user.partner_id):
        partner_channels = self.env['mail.channel.partner'].search([('partner_id', '=', self.env.user.partner_id.id), ('channel_id', 'in', self.ids)])
    for channel in self:
        info = {'id': channel.id, 'name': channel.name, 'uuid': channel.uuid, 'state': 'open', 'is_minimized': False, 'channel_type': channel.channel_type, 'public': channel.public, 'mass_mailing': channel.email_send}
        if extra_info:
            info['info'] = extra_info
        if (channel.channel_type == 'chat'):
            info['direct_partner'] = channel.sudo().with_context(active_test=False).channel_partner_ids.filtered((lambda p: (p.id != self.env.user.partner_id.id))).read(['id', 'name', 'im_status'])
        if partner_channels.ids:
            partner_channel = partner_channels.filtered((lambda c: (channel.id == c.channel_id.id)))
            if (len(partner_channel) >= 1):
                partner_channel = partner_channel[0]
                info['state'] = (partner_channel.fold_state or 'open')
                info['is_minimized'] = partner_channel.is_minimized
                info['seen_message_id'] = partner_channel.seen_message_id.id
            info['message_needaction_counter'] = channel.message_needaction_counter
            info['message_unread_counter'] = channel.message_unread_counter
        channel_infos.append(info)
    return channel_infos
