comparison frontends/src/primitivus/contact_list.py @ 1231:93a5e2673929

primitivus: fixes displaying online contacts when "Show offline contacts" is False
author souliane <souliane@mailoo.org>
date Tue, 07 Oct 2014 11:45:34 +0200
parents 3abc6563a0d2
children e3a9ea76de35
comparison
equal deleted inserted replaced
1230:3abc6563a0d2 1231:93a5e2673929
230 def contactToShow(self, contact): 230 def contactToShow(self, contact):
231 """Tell if the contact should be showed or hidden. 231 """Tell if the contact should be showed or hidden.
232 232
233 @param contact (str): JID userhost of the contact 233 @param contact (str): JID userhost of the contact
234 @return: True if that contact should be showed in the list""" 234 @return: True if that contact should be showed in the list"""
235 return self.getCache(JID(contact), 'show') != "unavailable" or self.show_disconnected or contact in self.alert_jid or contact == self.selected 235 show = self.getCache(JID(contact), 'show')
236 return (show is not None and show != "unavailable") or \
237 self.show_disconnected or contact in self.alert_jid or contact == self.selected
236 238
237 def nonEmptyGroup(self, contacts): 239 def nonEmptyGroup(self, contacts):
238 """Tell if a contact group contains some contacts to show. 240 """Tell if a contact group contains some contacts to show.
239 241
240 @param contacts (list[str]): list of JID userhosts 242 @param contacts (list[str]): list of JID userhosts