diff options
author | Lance Stout <lancestout@gmail.com> | 2011-02-11 15:20:26 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-02-11 15:20:26 -0500 |
commit | 0d326383799a7d7bb69fec9dcd1eaf9e1a64eab8 (patch) | |
tree | 20bf5d0037cdd33bf45460c7001dd593643293b0 /sleekxmpp/stanza/iq.py | |
parent | c4b1212c44e0758c6361ca46c6c3a90e27ac876f (diff) | |
download | slixmpp-0d326383799a7d7bb69fec9dcd1eaf9e1a64eab8.tar.gz slixmpp-0d326383799a7d7bb69fec9dcd1eaf9e1a64eab8.tar.bz2 slixmpp-0d326383799a7d7bb69fec9dcd1eaf9e1a64eab8.tar.xz slixmpp-0d326383799a7d7bb69fec9dcd1eaf9e1a64eab8.zip |
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.
Diffstat (limited to 'sleekxmpp/stanza/iq.py')
-rw-r--r-- | sleekxmpp/stanza/iq.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py index c6aa64d0..841d282c 100644 --- a/sleekxmpp/stanza/iq.py +++ b/sleekxmpp/stanza/iq.py @@ -144,7 +144,7 @@ class Iq(RootStanza): self.xml.remove(child) return self - def reply(self): + def reply(self, clear=True): """ Send a reply <iq> stanza. @@ -152,9 +152,13 @@ class Iq(RootStanza): Sets the 'type' to 'result' in addition to the default StanzaBase.reply behavior. + + Arguments: + clear -- Indicates if existing content should be + removed before replying. Defaults to True. """ self['type'] = 'result' - StanzaBase.reply(self) + StanzaBase.reply(self, clear) return self def send(self, block=True, timeout=None, callback=None): |