diff --git a/slixmpp/stanza/presence.py b/slixmpp/stanza/presence.py index 614cd331..7e59e1c5 100644 --- a/slixmpp/stanza/presence.py +++ b/slixmpp/stanza/presence.py @@ -90,10 +90,10 @@ class Presence(RootStanza): def get_type(self): """ Return the value of the stanza's type attribute, or - the value of the element. + the value of the element if valid. """ out = self._get_attr('type') - if not out: + if not out and self['show'] in self.showtypes: out = self['show'] if not out or out is None: out = 'available'