comparison frontends/src/wix/contact_list.py @ 737:378af36155c2

frontends: set and retrieve your own presence and status
author souliane <souliane@mailoo.org>
date Mon, 25 Nov 2013 01:56:07 +0100
parents 6246eb6d64a0
children bfabeedbf32e
comparison
equal deleted inserted replaced
736:6246eb6d64a0 737:378af36155c2
112 name = self.getCache(jid,'name') 112 name = self.getCache(jid,'name')
113 nick = self.getCache(jid,'nick') 113 nick = self.getCache(jid,'nick')
114 _show = self.getCache(jid,'show') 114 _show = self.getCache(jid,'show')
115 if _show == None or _show == 'unavailable': 115 if _show == None or _show == 'unavailable':
116 return None 116 return None
117 show = filter(lambda x : x[0] == _show, Const.PRESENCE)[0] 117 show = [x for x in Const.PRESENCE if x[0] == _show][0]
118 118
119 #show[0]==shortcut 119 #show[0]==shortcut
120 #show[1]==human readable 120 #show[1]==human readable
121 #show[2]==color (or None) 121 #show[2]==color (or None)
122 show_html = "<font color='%s'>[%s]</font>" % (show[2], show[1]) if show[2] else "" 122 show_html = "<font color='%s'>[%s]</font>" % (show[2], show[1]) if show[2] else ""