From d5dbe3616f2cf27e33b7ffdfa258f1719022e189 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 12 Aug 2010 15:04:34 +0200 Subject: [PATCH] Correctly use the connections from ConnectionManager --- src/sugar/presence/presenceservice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sugar/presence/presenceservice.py b/src/sugar/presence/presenceservice.py index 1eb5fa65..1ad9272f 100644 --- a/src/sugar/presence/presenceservice.py +++ b/src/sugar/presence/presenceservice.py @@ -1,4 +1,5 @@ # Copyright (C) 2007, Red Hat, Inc. +# Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -267,16 +268,18 @@ 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(): + if not connection.connected: + continue logging.debug("Calling GetActivity on %s", account_path) try: - room_handle = connection.GetActivity(activity_id) + room_handle = connection.connection.GetActivity(activity_id) except dbus.exceptions.DBusException, e: if e.get_dbus_name() == 'org.freedesktop.Telepathy.Error.NotAvailable': logging.debug("There's no shared activity with the id %s", activity_id) else: raise else: - activity = Activity(account_path, connection, + activity = Activity(account_path, connection.connection, room_handle=room_handle) self._activity_cache = activity return activity