Correctly use the connections from ConnectionManager
This commit is contained in:
parent
c0ed611aee
commit
d5dbe3616f
@ -1,4 +1,5 @@
|
|||||||
# Copyright (C) 2007, Red Hat, Inc.
|
# Copyright (C) 2007, Red Hat, Inc.
|
||||||
|
# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@ -267,16 +268,18 @@ class PresenceService(gobject.GObject):
|
|||||||
connection_manager = get_connection_manager()
|
connection_manager = get_connection_manager()
|
||||||
connections_per_account = connection_manager.get_connections_per_account()
|
connections_per_account = connection_manager.get_connections_per_account()
|
||||||
for account_path, connection in connections_per_account.items():
|
for account_path, connection in connections_per_account.items():
|
||||||
|
if not connection.connected:
|
||||||
|
continue
|
||||||
logging.debug("Calling GetActivity on %s", account_path)
|
logging.debug("Calling GetActivity on %s", account_path)
|
||||||
try:
|
try:
|
||||||
room_handle = connection.GetActivity(activity_id)
|
room_handle = connection.connection.GetActivity(activity_id)
|
||||||
except dbus.exceptions.DBusException, e:
|
except dbus.exceptions.DBusException, e:
|
||||||
if e.get_dbus_name() == 'org.freedesktop.Telepathy.Error.NotAvailable':
|
if e.get_dbus_name() == 'org.freedesktop.Telepathy.Error.NotAvailable':
|
||||||
logging.debug("There's no shared activity with the id %s", activity_id)
|
logging.debug("There's no shared activity with the id %s", activity_id)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
activity = Activity(account_path, connection,
|
activity = Activity(account_path, connection.connection,
|
||||||
room_handle=room_handle)
|
room_handle=room_handle)
|
||||||
self._activity_cache = activity
|
self._activity_cache = activity
|
||||||
return activity
|
return activity
|
||||||
|
Loading…
Reference in New Issue
Block a user