summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/presence.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-02-14 16:18:44 -0500
committerLance Stout <lancestout@gmail.com>2011-02-14 16:18:44 -0500
commita278f79bdbdb842193092a9e0176ecb8b1867762 (patch)
treec55be3e45f61133c01969be201d3a6476dbe5762 /sleekxmpp/stanza/presence.py
parent606c369173e7a31d793540d90e425a78c2a81253 (diff)
parentd709f8db657aa1d1314082d842dd29e2546739c4 (diff)
downloadslixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.tar.gz
slixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.tar.bz2
slixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.tar.xz
slixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.zip
Merge branch 'develop' into roster
Conflicts: sleekxmpp/clientxmpp.py
Diffstat (limited to 'sleekxmpp/stanza/presence.py')
-rw-r--r--sleekxmpp/stanza/presence.py38
1 files changed, 16 insertions, 22 deletions
diff --git a/sleekxmpp/stanza/presence.py b/sleekxmpp/stanza/presence.py
index 7dcd8f90..c8706233 100644
--- a/sleekxmpp/stanza/presence.py
+++ b/sleekxmpp/stanza/presence.py
@@ -72,26 +72,6 @@ class Presence(RootStanza):
'subscribed', 'unsubscribe', 'unsubscribed'))
showtypes = set(('dnd', 'chat', 'xa', 'away'))
- def setup(self, xml=None):
- """
- Populate the stanza object using an optional XML object.
-
- Overrides ElementBase.setup.
-
- Arguments:
- xml -- Use an existing XML object for the stanza's values.
- """
- # To comply with PEP8, method names now use underscores.
- # Deprecated method names are re-mapped for backwards compatibility.
- self.setShow = self.set_show
- self.getType = self.get_type
- self.setType = self.set_type
- self.delType = self.get_type
- self.getPriority = self.get_priority
- self.setPriority = self.set_priority
-
- return StanzaBase.setup(self, xml)
-
def exception(self, e):
"""
Override exception passback for presence.
@@ -173,14 +153,28 @@ class Presence(RootStanza):
# The priority is not a number: we consider it 0 as a default
return 0
- def reply(self):
+ def reply(self, clear=True):
"""
Set the appropriate presence reply type.
Overrides StanzaBase.reply.
+
+ Arguments:
+ clear -- Indicates if the stanza contents should be removed
+ before replying. Defaults to True.
"""
if self['type'] == 'unsubscribe':
self['type'] = 'unsubscribed'
elif self['type'] == 'subscribe':
self['type'] = 'subscribed'
- return StanzaBase.reply(self)
+ return StanzaBase.reply(self, clear)
+
+
+# To comply with PEP8, method names now use underscores.
+# Deprecated method names are re-mapped for backwards compatibility.
+Presence.setShow = Presence.set_show
+Presence.getType = Presence.get_type
+Presence.setType = Presence.set_type
+Presence.delType = Presence.get_type
+Presence.getPriority = Presence.get_priority
+Presence.setPriority = Presence.set_priority