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
2 changed files with 11 additions and 1 deletions
|
@ -65,6 +65,16 @@ class CommonContact(XMPPEntity):
|
||||||
# this is contact's chatstate
|
# this is contact's chatstate
|
||||||
self.chatstate = 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):
|
def get_full_jid(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
|
@ -420,7 +420,7 @@ def get_css_show_color(show):
|
||||||
return None
|
return None
|
||||||
elif show in ('xa', 'dnd'):
|
elif show in ('xa', 'dnd'):
|
||||||
return 'status-dnd'
|
return 'status-dnd'
|
||||||
elif show in ('away'):
|
elif show == 'away':
|
||||||
return 'status-away'
|
return 'status-away'
|
||||||
|
|
||||||
def get_uf_sub(sub):
|
def get_uf_sub(sub):
|
||||||
|
|
Loading…
Add table
Reference in a new issue