From e02ffe854745c6c39127967f5d1dcaff915d7190 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 7 Oct 2010 19:42:28 -0400 Subject: Corrected test errors. There was a bug in the XML compare method. --- sleekxmpp/stanza/presence.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/stanza/presence.py') diff --git a/sleekxmpp/stanza/presence.py b/sleekxmpp/stanza/presence.py index 651bf34d..7eb0c5b1 100644 --- a/sleekxmpp/stanza/presence.py +++ b/sleekxmpp/stanza/presence.py @@ -78,7 +78,9 @@ class Presence(RootStanza): Arguments: show -- Must be one of: away, chat, dnd, or xa. """ - if show in self.showtypes: + if show is None: + self._delSub('show') + elif show in self.showtypes: self._setSubText('show', text=show) return self @@ -99,6 +101,14 @@ class Presence(RootStanza): self['show'] = value return self + def delType(self): + """ + Remove both the type attribute and the element. + """ + self._delAttr('type') + self._delSub('show') + + def setPriority(self, value): """ Set the entity's priority value. Some server use priority to -- cgit v1.2.3