XMPPError exceptions can keep a stanza's contents.

This allows exceptions to include the original
content of a stanza in the error response by including
the parameter clear=False when raising the exception.
This commit is contained in:
Lance Stout
2011-02-11 15:20:26 -05:00
parent c4b1212c44
commit 0d32638379
7 changed files with 71 additions and 12 deletions

View File

@@ -104,7 +104,7 @@ class Message(RootStanza):
self['type'] = 'normal'
return self
def reply(self, body=None):
def reply(self, body=None, clear=True):
"""
Create a message reply.
@@ -114,7 +114,9 @@ class Message(RootStanza):
adds a message body if one is given.
Arguments:
body -- Optional text content for the message.
body -- Optional text content for the message.
clear -- Indicates if existing content should be removed
before replying. Defaults to True.
"""
StanzaBase.reply(self)
if self['type'] == 'groupchat':