Make sure show is always a string
This is so we hopefully can find some bugs
This commit is contained in:
parent
672f02b3b0
commit
af11aa985b
|
@ -65,6 +65,16 @@ class CommonContact(XMPPEntity):
|
|||
# this is contact's chatstate
|
||||
self.chatstate = chatstate
|
||||
|
||||
@property
|
||||
def show(self):
|
||||
return self._show
|
||||
|
||||
@show.setter
|
||||
def show(self, value):
|
||||
if not isinstance(value, str):
|
||||
raise TypeError('show must be a string')
|
||||
self._show = value
|
||||
|
||||
def get_full_jid(self):
|
||||
raise NotImplementedError
|
||||
|
||||
|
|
|
@ -420,7 +420,7 @@ def get_css_show_color(show):
|
|||
return None
|
||||
elif show in ('xa', 'dnd'):
|
||||
return 'status-dnd'
|
||||
elif show in ('away'):
|
||||
elif show == 'away':
|
||||
return 'status-away'
|
||||
|
||||
def get_uf_sub(sub):
|
||||
|
|
Loading…
Reference in New Issue