diff options
author | Nathan Fritz <fritzy@netflint.net> | 2010-01-27 15:09:45 -0800 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2010-01-27 15:09:45 -0800 |
commit | f159328dc436632450e09ed4a2992e7e7f9afde4 (patch) | |
tree | 59f26e2cc6c87762cedf40e41c318f79fce408b4 /sleekxmpp/stanza | |
parent | a4ec7413e4dc9246f4612b73fca9b9d842287e44 (diff) | |
parent | 3dbd496de8b6d358b657eada91acc6b71455ffbf (diff) | |
download | slixmpp-f159328dc436632450e09ed4a2992e7e7f9afde4.tar.gz slixmpp-f159328dc436632450e09ed4a2992e7e7f9afde4.tar.bz2 slixmpp-f159328dc436632450e09ed4a2992e7e7f9afde4.tar.xz slixmpp-f159328dc436632450e09ed4a2992e7e7f9afde4.zip |
Merge branch 'master' of github.com:fritzy/SleekXMPP
Diffstat (limited to 'sleekxmpp/stanza')
-rw-r--r-- | sleekxmpp/stanza/presence.py | 22 |
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): |