Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-10-19 22:17:20 (GMT)
committer Jonas Smedegaard <dr@jones.dk>2008-10-19 22:17:20 (GMT)
commite72299347c7fd844366a103f3cfc6c34d7001d3d (patch)
treea7518f315f8869c53cab52fa781a859790ba77b9
parent1afdecb26584887144d3a9131f3acffdf194f91e (diff)
parent3e1e63157aee2e36f2d1c895655661c9e19c58ef (diff)
Merge commit 'v0.82.2'
-rw-r--r--NEWS17
-rw-r--r--configure.ac2
-rw-r--r--src/telepathy_plugin.py27
3 files changed, 43 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index be61a11..9267d65 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,20 @@
+sugar-presence-service 0.82.2 (2008-08-08)
+==========================================
+
+The "I should use pyflakes more often" release.
+
+This brown paper bag release fixes a stupid name error in #5618 fixe.
+
+sugar-presence-service 0.82.1 (2008-08-07)
+==========================================
+
+The "One more bug fixed" release.
+
+Fixes:
+
+* dev.laptop.org #5618: PS should drop handles causing InspectHandles failing
+
+
sugar-presence-service 0.82.0 (2008-08-06)
==========================================
diff --git a/configure.ac b/configure.ac
index 8ffeedc..aa5cbc6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([Sugar Presence Service],[0.82.0],[],[sugar-presence-service])
+AC_INIT([Sugar Presence Service],[0.82.2],[],[sugar-presence-service])
AC_PREREQ([2.59])
diff --git a/src/telepathy_plugin.py b/src/telepathy_plugin.py
index 2042111..25bbd1c 100644
--- a/src/telepathy_plugin.py
+++ b/src/telepathy_plugin.py
@@ -35,6 +35,7 @@ from telepathy.interfaces import (CONN_INTERFACE, CHANNEL_TYPE_TEXT,
CONN_INTERFACE_PRESENCE, CONN_INTERFACE_AVATARS,
CONN_INTERFACE_ALIASING, CHANNEL_TYPE_CONTACT_LIST,
CONN_MGR_INTERFACE)
+from telepathy.errors import (InvalidArgument, InvalidHandle)
import psutils
@@ -356,6 +357,20 @@ class TelepathyPlugin(gobject.GObject):
_logger.debug('%r: Contacts now offline: %r', self, handles)
self.emit("contacts-offline", handles)
+ def _inspect_handles_one_by_one(self, handle_type, handles):
+ jids = []
+
+ for handle in handles:
+ try:
+ jid = self._conn[CONN_INTERFACE].InspectHandles(handle_type,
+ [handle])
+ except (InvalidArgument, InvalidHandle):
+ continue
+ else:
+ jids.append(jid[0])
+
+ return jids
+
def _contacts_online(self, handles):
"""Handle contacts coming online"""
relevant = []
@@ -375,8 +390,16 @@ class TelepathyPlugin(gobject.GObject):
if not relevant:
return
- jids = self._conn[CONN_INTERFACE].InspectHandles(
- HANDLE_TYPE_CONTACT, relevant)
+ try:
+ jids = self._conn[CONN_INTERFACE].InspectHandles(
+ HANDLE_TYPE_CONTACT, relevant)
+ except (InvalidArgument, InvalidHandle):
+ # InspectHandles failed so discard invalid handles by trying to
+ # inspect them one by one.
+ # FIXME: the Contacts interface should offer a proper way to do this.
+ jids = self._inspect_handles_one_by_one(HANDLE_TYPE_CONTACT, relevant)
+ if not jids:
+ return
handle_to_objid = self.identify_contacts(None, relevant, jids)
objids = []