comparison sat_frontends/quick_frontend/quick_contact_list.py @ 2828:08b54bf77c54

primitivus(contact list): fixed room not always appearing correctly in contact list
author Goffi <goffi@goffi.org>
date Fri, 01 Mar 2019 17:33:15 +0100
parents 003b8b4b56a7
children 82d8243e6ad1
comparison
equal deleted inserted replaced
2827:9a3b99acad91 2828:08b54bf77c54
342 342
343 @param group: a valid (existing) group name 343 @param group: a valid (existing) group name
344 @param name: name of the data (can't be "jids") 344 @param name: name of the data (can't be "jids")
345 @param value: value to set 345 @param value: value to set
346 """ 346 """
347 assert name is not "jids" 347 assert name != "jids"
348 self._groups[group][name] = value 348 self._groups[group][name] = value
349 349
350 def getGroupData(self, group, name=None): 350 def getGroupData(self, group, name=None):
351 """Return value associated to group data 351 """Return value associated to group data
352 352
423 self._specials.clear() 423 self._specials.clear()
424 self._roster.clear() 424 self._roster.clear()
425 self.update() 425 self.update()
426 426
427 def setContact(self, entity, groups=None, attributes=None, in_roster=False): 427 def setContact(self, entity, groups=None, attributes=None, in_roster=False):
428 """Add a contact to the list if doesn't exist, else update it. 428 """Add a contact to the list if it doesn't exist, else update it.
429 429
430 This method can be called with groups=None for the purpose of updating 430 This method can be called with groups=None for the purpose of updating
431 the contact's attributes (e.g. nickname). In that case, the groups 431 the contact's attributes (e.g. nickname). In that case, the groups
432 attribute must not be set to the default group but ignored. If not, 432 attribute must not be set to the default group but ignored. If not,
433 you may move your contact from its actual group(s) to the default one. 433 you may move your contact from its actual group(s) to the default one.
550 or entity in selected 550 or entity in selected
551 or ( 551 or (
552 self.show_entities_with_notifs 552 self.show_entities_with_notifs
553 and next(self.host.getNotifs(entity.bare, profile=self.profile), None) 553 and next(self.host.getNotifs(entity.bare, profile=self.profile), None)
554 ) 554 )
555 or entity.resource is None and self.isRoom(entity.bare)
555 ) 556 )
556 557
557 def anyEntityVisible(self, entities, check_resources=False): 558 def anyEntityVisible(self, entities, check_resources=False):
558 """Tell if in a list of entities, at least one should be shown 559 """Tell if in a list of entities, at least one should be shown
559 560
765 super(QuickContactListHandler, self).__init__() 766 super(QuickContactListHandler, self).__init__()
766 self.host = host 767 self.host = host
767 global handler 768 global handler
768 if handler is not None: 769 if handler is not None:
769 raise exceptions.InternalError( 770 raise exceptions.InternalError(
770 u"QuickContactListHandler must be " u"instanciated only once" 771 u"QuickContactListHandler must be instanciated only once"
771 ) 772 )
772 handler = self 773 handler = self
773 self._clist = {} # key: profile, value: ProfileContactList 774 self._clist = {} # key: profile, value: ProfileContactList
774 self._widgets = set() 775 self._widgets = set()
775 self._update_locked = False # se to True to ignore updates 776 self._update_locked = False # se to True to ignore updates