Mercurial > libervia-backend
diff frontends/src/primitivus/contact_list.py @ 688:f7878ad3c846
tools: renamed tools.jid.JID attribute "short" to "bare"
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 29 Oct 2013 16:26:55 +0100 |
parents | 0b9bd47dffcd |
children | 6246eb6d64a0 |
line wrap: on
line diff
--- a/frontends/src/primitivus/contact_list.py Mon Oct 28 19:04:49 2013 +0100 +++ b/frontends/src/primitivus/contact_list.py Tue Oct 29 16:26:55 2013 +0100 @@ -70,7 +70,7 @@ def __contains__(self, jid): for group in self.groups: - if jid.short in self.groups[group][1]: + if jid.bare in self.groups[group][1]: return True return False @@ -108,7 +108,7 @@ def putAlert(self, jid): """Put an alert on the jid to get attention from user (e.g. for new message)""" - self.alert_jid.add(jid.short) + self.alert_jid.add(jid.bare) self.update() def __groupClicked(self, group_wid): @@ -153,7 +153,7 @@ and not contact in self.alert_jid and contact != self.selected): continue show_icon, show_attr = const_SHOW_ICON.get(show,('','default')) - contact_disp = ('alert' if contact in self.alert_jid else show_attr, nick or name or jid.node or jid.short) + contact_disp = ('alert' if contact in self.alert_jid else show_attr, nick or name or jid.node or jid.bare) display = [ show_icon + " " , contact_disp] if self.show_status: status_disp = ('status',"\n " + status) if status else "" @@ -180,7 +180,7 @@ jid=JID(special) name = self.getCache(jid, 'name') nick = self.getCache(jid, 'nick') - special_disp = ('alert' if special in self.alert_jid else 'default', nick or name or jid.node or jid.short) + special_disp = ('alert' if special in self.alert_jid else 'default', nick or name or jid.node or jid.bare) display = [ " " , special_disp] header = '(*) ' if special in self.alert_jid else '' widget = sat_widgets.SelectableText(display, @@ -233,7 +233,7 @@ def replace(self, jid, groups=None, attributes=None): """add a contact to the list if doesn't exist, else update it""" QuickContactList.replace(self, jid, groups, attributes) - if jid.short in self.specials: + if jid.bare in self.specials: return if not groups: groups = [None] @@ -244,7 +244,7 @@ for group in groups: if not self.groups.has_key(group): self.groups[group] = [True,set()] #[unfold,list_of_contacts] - self.groups[group][1].add(jid.short) + self.groups[group][1].add(jid.bare) self.update() def remove(self, jid): @@ -253,8 +253,8 @@ groups_to_remove = [] for group in self.groups: contacts = self.groups[group][1] - if jid.short in contacts: - contacts.remove(jid.short) + if jid.bare in contacts: + contacts.remove(jid.bare) if not len(contacts): groups_to_remove.append(group) for group in groups_to_remove: @@ -275,7 +275,7 @@ if None in self.groups: folded, group_jids = self.groups[None] for group_jid in group_jids: - if JID(group_jid).short == special_jid.short: + if JID(group_jid).bare == special_jid.bare: group_jids.remove(group_jid) break self.update() @@ -286,5 +286,5 @@ def updatePresence(self, jid, show, priority, statuses): #XXX: for the moment, we ignore presence updates for special entities - if jid.short not in self.specials: + if jid.bare not in self.specials: QuickContactList.updatePresence(self, jid, show, priority, statuses)