'Toggle messages as (un)starred. Technically, the notifications related
to uid are set to (un)starred.'

@api.multi
def toggle_message_starred(self):

    self.check_access_rule('read')
    starred = (not self.starred)
    if starred:
        self.sudo().write({'starred_partner_ids': [(4, self.env.user.partner_id.id)]})
    else:
        self.sudo().write({'starred_partner_ids': [(3, self.env.user.partner_id.id)]})
    notification = {'type': 'toggle_star', 'message_ids': [self.id], 'starred': starred}
    self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', self.env.user.partner_id.id), notification)
