[Telepathy-commits] [mingle/master] Add ability to get contacts from client based on jid

Sjoerd Simons sjoerd at luon.net
Thu Oct 30 10:09:36 PDT 2008


---
 client.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/client.py b/client.py
index a7a55a1..264e2f4 100644
--- a/client.py
+++ b/client.py
@@ -128,6 +128,13 @@ class Client:
         t = (type, namespace, name)
         self.iq_dispatch[t].pop(id)
 
+    def get_contact (self, jid):
+        resource_dict = self.contacts.setdefault(jid.userhost(), {})
+        if resource_dict.has_key(jid.resource):
+            return resource_dict[jid.resource]
+
+        return None
+
     def presence(self, stanza):
         if None in (stanza.getAttribute('to'),
                     stanza.getAttribute('from')):
-- 
1.5.6.5




More information about the Telepathy-commits mailing list