'Create a message reply.
Overrides StanzaBase.reply.
Sets proper \'to\' attribute if the message is from a MUC, and
adds a message body if one is given.
Arguments:
body  -- Optional text content for the message.
clear -- Indicates if existing content should be removed
before replying. Defaults to True.'

def reply(self, body=None, clear=True):

    thread = self['thread']
    parent = self['parent_thread']
    StanzaBase.reply(self, clear)
    if (self['type'] == 'groupchat'):
        self['to'] = self['to'].bare
    self['thread'] = thread
    self['parent_thread'] = parent
    del self['id']
    if (body is not None):
        self['body'] = body
    return self
