# HG changeset patch # User souliane # Date 1413535330 -7200 # Node ID f0c8a4d5189063dc5e1447e321f34372c5b5719a # Parent 2a4e071633f7c1abdffd149a0e0b5bc683e61f41 browser_side: print a warning when trying to access a non existing contact box: This occurs when you receive updatePresence of a MUC occupant before Libervia knows that this is a MUC. Actually you shouldn't receive presence update for the occupant before the MUC widget is displayed, this means a loss of information. One way to fix it is to modify (un)availableReceived in sat.core.xmpp: check for the entity data "type" or make a disco request if it doesn't exist, and an attribute to presenceUpdate to tell the frontend if we have a MUC occupant or a roster contact. diff -r 2a4e071633f7 -r f0c8a4d51890 src/browser/sat_browser/contact.py --- a/src/browser/sat_browser/contact.py Sat Oct 11 16:28:27 2014 +0200 +++ b/src/browser/sat_browser/contact.py Fri Oct 17 10:42:10 2014 +0200 @@ -521,9 +521,15 @@ @param groups (list[str]): list of groups """ for jid_s in jids: - self._contact_list.getContactBox(jid_s).setVisible(jid_s in self.connected or self.offlineContactsToShow()) + try: + self._contact_list.getContactBox(jid_s).setVisible(jid_s in self.connected or self.offlineContactsToShow()) + except TypeError: + log.warning('No box for contact %s: this code line should not be reached' % jid_s) for group in groups: - self._groupList.getGroupBox(group).setVisible(self.hasVisibleMembers(group) or self.emtyGroupsToShow()) + try: + self._groupList.getGroupBox(group).setVisible(self.hasVisibleMembers(group) or self.emtyGroupsToShow()) + except TypeError: + log.warning('No box for group %s: this code line should not be reached' % group) def refresh(self): """Show or hide disconnected contacts and empty groups"""