# HG changeset patch # User Goffi # Date 1580156229 -3600 # Node ID 3002704318e331a35ecd95dec3418a91a7bb696f # Parent 5d994be1161b68c615d177229819bd719dff16a2 core (common_widgets): fixed own jid detection in DeviceWidget + `name` property in Identities diff -r 5d994be1161b -r 3002704318e3 cagou/core/common_widgets.py --- a/cagou/core/common_widgets.py Mon Jan 27 21:17:09 2020 +0100 +++ b/cagou/core/common_widgets.py Mon Jan 27 21:17:09 2020 +0100 @@ -77,7 +77,9 @@ @property def name(self): - return list(self.identities.values())[0].values()[0][0] + first_identity = next(iter(self.identities.values())) + names = next(iter(first_identity.values())) + return names[0] class ItemWidget(TouchMenuItemBehaviour, BoxLayout): @@ -91,7 +93,7 @@ self.entity_jid = entity_jid self.identities = identities own_jid = next(iter(G.host.profiles.values())).whoami - self.own_device = entity_jid.bare == own_jid + self.own_device = entity_jid.bare == own_jid.bare if self.own_device: name = self.identities.name elif self.entity_jid.node: