From a54aaa54beacf1579c5fe14c7ebf8c45de3a8c6a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 30 May 2007 17:41:08 +0100 Subject: [PATCH] services/presence/presenceservice: look up buddies by key-ID if we don't know the full key yet. --- services/presence/presenceservice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/presence/presenceservice.py b/services/presence/presenceservice.py index 6c17082e..5bcfd45d 100644 --- a/services/presence/presenceservice.py +++ b/services/presence/presenceservice.py @@ -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()