Make sure show is always a string

This is so we hopefully can find some bugs
This commit is contained in:
Philipp Hörist 2018-06-22 20:23:35 +02:00
parent 672f02b3b0
commit af11aa985b
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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):