Mercurial > libervia-backend
comparison sat/core/sat_main.py @ 2977:06f30ad8e110
core: return full jid in bridge's getContacts:
getContacts was returning only bare jid of entities, but jids with resources may be present in roster, so this behaviour has been changed.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 30 Jun 2019 15:43:57 +0200 |
parents | 25f14fbd364e |
children | 6959c71ab8bf |
comparison
equal
deleted
inserted
replaced
2976:49458e12e414 | 2977:06f30ad8e110 |
---|---|
501 def got_roster(__): | 501 def got_roster(__): |
502 ret = [] | 502 ret = [] |
503 for item in client.roster.getItems(): # we get all items for client's roster | 503 for item in client.roster.getItems(): # we get all items for client's roster |
504 # and convert them to expected format | 504 # and convert them to expected format |
505 attr = client.roster.getAttributes(item) | 505 attr = client.roster.getAttributes(item) |
506 ret.append([item.jid.userhost(), attr, item.groups]) | 506 # we use full() and not userhost() because jid with resources are allowed |
507 # in roster, even if it's not common. | |
508 ret.append([item.entity.full(), attr, item.groups]) | |
507 return ret | 509 return ret |
508 | 510 |
509 return client.roster.got_roster.addCallback(got_roster) | 511 return client.roster.got_roster.addCallback(got_roster) |
510 | 512 |
511 def getContactsFromGroup(self, group, profile_key): | 513 def getContactsFromGroup(self, group, profile_key): |