diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2010-07-15 08:50:05 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2010-08-20 13:33:53 (GMT) |
commit | 363f82820557e3b15e6c36334bceeae1f863ed31 (patch) | |
tree | e1a4433cf5a5197a443d3f92359007bee6b96f34 /src/sugar/presence/presenceservice.py | |
parent | af6e3aa5ef284ed9184f149b119707496747f3a5 (diff) |
Handle invitations using Mission Control 5.
src/sugar/activity/activity.py: If the activity is being invoked to
handle an invite, create a Client.Handler instance and share the
activity when HandleChannels is invoked.
src/sugar/activity/activityfactory.py,
src/sugar/activity/activityhandle.py,
src/sugar/activity/main.py: Add a -i switch that indicates to the
activity that it should handle the channel from an invitation.
src/sugar/presence/activity.py: Expose Activity.room_handle.
src/sugar/presence/presenceservice.py: Add get_activity_by_handle().
src/sugar/presence/util.py: Add get_account_for_connection().
Diffstat (limited to 'src/sugar/presence/presenceservice.py')
-rw-r--r-- | src/sugar/presence/presenceservice.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/sugar/presence/presenceservice.py b/src/sugar/presence/presenceservice.py index d0e20dc..02f727c 100644 --- a/src/sugar/presence/presenceservice.py +++ b/src/sugar/presence/presenceservice.py @@ -280,6 +280,24 @@ class PresenceService(gobject.GObject): return None + def get_activity_by_handle(self, connection_path, room_handle): + if self._activity_cache is not None: + if self._activity_cache.room_handle != room_handle: + raise RuntimeError('Activities can only access their own shared' + 'instance') + return self._activity_cache + else: + connection_manager = get_connection_manager() + account_path = connection_manager.get_account_for_connection(connection_path) + + connection_name = connection_path.replace('/', '.')[1:] + bus = dbus.SessionBus() + connection = bus.get_object(connection_name, connection_path) + activity = Activity(account_path, connection, + room_handle=room_handle) + self._activity_cache = activity + return activity + def get_buddies(self): """Retrieve set of all buddies from service |