summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/presence.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2010-01-23 01:08:21 -0800
committerNathan Fritz <fritzy@netflint.net>2010-01-23 01:08:21 -0800
commit3dbd496de8b6d358b657eada91acc6b71455ffbf (patch)
treeab7615b372d9c1206ea44e16da984abdcb5eb425 /sleekxmpp/stanza/presence.py
parent65dd83d4e174fc5f88ea90b32dd9e3ebf1787294 (diff)
downloadslixmpp-3dbd496de8b6d358b657eada91acc6b71455ffbf.tar.gz
slixmpp-3dbd496de8b6d358b657eada91acc6b71455ffbf.tar.bz2
slixmpp-3dbd496de8b6d358b657eada91acc6b71455ffbf.tar.xz
slixmpp-3dbd496de8b6d358b657eada91acc6b71455ffbf.zip
fixed presence['type'] w/ show value bug and added test to prove
Diffstat (limited to 'sleekxmpp/stanza/presence.py')
-rw-r--r--sleekxmpp/stanza/presence.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/sleekxmpp/stanza/presence.py b/sleekxmpp/stanza/presence.py
index 6a8247c5..2bf767d4 100644
--- a/sleekxmpp/stanza/presence.py
+++ b/sleekxmpp/stanza/presence.py
@@ -15,18 +15,18 @@ class Presence(RootStanza):
return self.xml.find("{%s}show" % self.namespace)
def setType(self, value):
+ show = self.getShowElement()
if value in self.types:
- show = self.getShowElement()
- if value in self.types:
- if show is not None:
- self.xml.remove(show)
- if value == 'available':
- value = ''
- self._setAttr('type', value)
- elif value in self.showtypes:
- if show is None:
- show = ET.Element("{%s}show" % self.namespace)
- show.text = value
+ if show is not None:
+ self.xml.remove(show)
+ if value == 'available':
+ value = ''
+ self._setAttr('type', value)
+ elif value in self.showtypes:
+ if show is None:
+ show = ET.Element("{%s}show" % self.namespace)
+ self.xml.append(show)
+ show.text = value
return self
def setPriority(self, value):