'Handle composition mode. Some details about context keys:
- comment: default mode, model and ID of a record the user comments
- default_model or active_model
- default_res_id or active_id
- reply: active_id of a message the user replies to
- default_parent_id or message_id or active_id: ID of the
mail.message we reply to
- message.res_model or default_model
- message.res_id or default_res_id
- mass_mail: model and IDs of records the user mass-mails
- active_ids: record IDs
- default_model or active_model'

@api.model
def default_get(self, fields):

    result = super(MailComposer, self).default_get(fields)
    result['composition_mode'] = result.get('composition_mode', self._context.get('mail.compose.message.mode', 'comment'))
    result['model'] = result.get('model', self._context.get('active_model'))
    result['res_id'] = result.get('res_id', self._context.get('active_id'))
    result['parent_id'] = result.get('parent_id', self._context.get('message_id'))
    if (('no_auto_thread' not in result) and ((result['model'] not in self.env) or (not hasattr(self.env[result['model']], 'message_post')))):
        result['no_auto_thread'] = True
    if (result['composition_mode'] == 'reply'):
        result['composition_mode'] = 'comment'
    vals = {}
    if ('active_domain' in self._context):
        vals['use_active_domain'] = True
        vals['active_domain'] = ('%s' % self._context.get('active_domain'))
    if (result['composition_mode'] == 'comment'):
        vals.update(self.get_record_data(result))
    for field in vals:
        if (field in fields):
            result[field] = vals[field]
    if ((result['model'] == 'res.users') and (result['res_id'] == self._uid)):
        result['model'] = 'res.partner'
        result['res_id'] = self.env.user.partner_id.id
    if (fields is not None):
        [result.pop(field, None) for field in result.keys() if (field not in fields)]
    return result
