services/presence/presenceservice: look up buddies by key-ID if we don't know the full key yet.

This commit is contained in:
Simon McVittie 2007-05-30 17:41:08 +01:00
parent f90de752f6
commit a54aaa54be

View File

@ -350,6 +350,11 @@ class PresenceService(ExportedGObject):
byte_arrays=True)
def GetBuddyByPublicKey(self, key):
buddy = self._buddies_by_pubkey.get(key)
if buddy is not None:
if buddy.props.valid:
return buddy.object_path()
keyid = pubkey_to_keyid(key)
buddy = self._buddies.get('keyid/' + keyid)
if buddy is not None:
if buddy.props.valid:
return buddy.object_path()