presence: Ensure <show/> value is valid when returned as presence @type value
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
946674f424
commit
60a7a5b8df
1 changed files with 2 additions and 2 deletions
|
@ -90,10 +90,10 @@ class Presence(RootStanza):
|
||||||
def get_type(self):
|
def get_type(self):
|
||||||
"""
|
"""
|
||||||
Return the value of the <presence> stanza's type attribute, or
|
Return the value of the <presence> stanza's type attribute, or
|
||||||
the value of the <show> element.
|
the value of the <show> element if valid.
|
||||||
"""
|
"""
|
||||||
out = self._get_attr('type')
|
out = self._get_attr('type')
|
||||||
if not out:
|
if not out and self['show'] in self.showtypes:
|
||||||
out = self['show']
|
out = self['show']
|
||||||
if not out or out is None:
|
if not out or out is None:
|
||||||
out = 'available'
|
out = 'available'
|
||||||
|
|
Loading…
Reference in a new issue