CLI: don't fail when calling getContacts with a component profile

This commit is contained in:
Goffi 2022-05-13 19:15:30 +02:00
commit da7a90abd2

View file

@ -801,7 +801,17 @@ class LiberviaCli:
names2jid = {}
nodes2jid = {}
for contact in await self.bridge.getContacts(self.profile):
try:
contacts = await self.bridge.getContacts(self.profile)
except BridgeException as e:
if e.classname == "AttributeError":
# we may get an AttributeError if we use a component profile
# as components don't have roster
contacts = []
else:
raise e
for contact in contacts:
jid_s, attr, groups = contact
_jid = JID(jid_s)
try: