From af6e3aa5ef284ed9184f149b119707496747f3a5 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 13 Jul 2010 11:57:03 +0000 Subject: Restore use of ActivityProperties.GetActivity --- diff --git a/src/sugar/presence/presenceservice.py b/src/sugar/presence/presenceservice.py index 6b42290..d0e20dc 100644 --- a/src/sugar/presence/presenceservice.py +++ b/src/sugar/presence/presenceservice.py @@ -267,13 +267,16 @@ class PresenceService(gobject.GObject): connection_manager = get_connection_manager() connections_per_account = connection_manager.get_connections_per_account() for account_path, connection in connections_per_account.items(): - room_handles = connection.RequestHandles(HANDLE_TYPE_ROOM, - [activity_id], - dbus_interface=CONNECTION) - activity = Activity(account_path, connection, - room_handle=room_handles[0]) - self._activity_cache = activity - return activity + try: + room_handle = connection.GetActivity(activity_id) + except dbus.exceptions.DBusException, e: + if e.get_dbus_name() != 'org.freedesktop.Telepathy.Error.NotAvailable': + raise + else: + activity = Activity(account_path, connection, + room_handle=room_handle) + self._activity_cache = activity + return activity return None -- cgit v0.9.1