From 363f82820557e3b15e6c36334bceeae1f863ed31 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 15 Jul 2010 08:50:05 +0000 Subject: 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(). --- (limited to 'src/sugar/activity/main.py') diff --git a/src/sugar/activity/main.py b/src/sugar/activity/main.py index 0647e81..b66b0e8 100644 --- a/src/sugar/activity/main.py +++ b/src/sugar/activity/main.py @@ -75,6 +75,10 @@ def main(): parser.add_option('-s', '--single-process', dest='single_process', action='store_true', help='start all the instances in the same process') + parser.add_option('-i', '--handle-invite', dest='handle_invite', + action='store_true', + help='the activity is being launched for handling an ' + 'invite from the network') (options, args) = parser.parse_args() logger.start() @@ -121,7 +125,8 @@ def main(): activity_constructor = getattr(module, class_name) activity_handle = activityhandle.ActivityHandle( activity_id=options.activity_id, - object_id=options.object_id, uri=options.uri) + object_id=options.object_id, uri=options.uri, + handle_invite=options.handle_invite) if options.single_process is True: sessionbus = dbus.SessionBus() -- cgit v0.9.1