'From etoys3.0 of 7 March 2008 [Letztes Update: #2119] on 2 September 2008 at 4:28:23 pm'! "Change Set: invites-bf Date: 2 September 2008 Author: Bert Freudenberg Add invitation support (#5280)"! !SugarEtoysActivity methodsFor: 'dbus methods' stamp: 'bf 9/2/2008 15:45'! invite: aBuddyKey self dbusMethod: 'org.laptop.Activity.Invite'. SugarLauncher current invite: aBuddyKey! ! !SugarLauncher methodsFor: 'commands' stamp: 'bf 9/2/2008 16:28'! invite: aBuddyKey "aBuddy was invited to our activity." | buddy | Utilities informUser: 'Inviting buddy ...' translated during: [ self isShared ifFalse: [ self sharePublicly: false. SugarNavigatorBar current joinSharedActivity]. buddy := self presence getBuddyByPublicKey: aBuddyKey asByteArray. sharedActivity invite: buddy with: '']. ! ! !SugarLauncher methodsFor: 'presence' stamp: 'bf 9/2/2008 16:02'! sharePublicly: aBoolean sharedActivity ifNotNil: [^self]. sharedActivity := self presence shareActivity: self activityId with: self bundleId with: (self titleFromProject: Project current) squeakToUtf8 with: Dictionary new. "due to bug 4660 we can't pass properties directly" sharedActivity setProperties: ({'private' -> aBoolean not} as: Dictionary). self setupBuddies. self enableSharedActivitySignals. self setupTubes. ! ! !SugarNavigatorBar methodsFor: 'sharing' stamp: 'bf 9/2/2008 15:56'! joinSharedActivity self startP2P. self sharingChanged.! ! !SugarNavigatorBar methodsFor: 'sharing' stamp: 'bf 9/2/2008 15:56'! sharingChanged | state | state := SugarLauncher current isShared ifTrue: ['share'] ifFalse: ['private']. SugarLibrary default recolorButton: shareButton for: state baseColor: self color highLightColor: self highlightColor. ! ! !SugarNavigatorBar methodsFor: 'sharing' stamp: 'bf 9/2/2008 16:02'! startSharing SugarLauncher current sharePublicly: true. self joinSharedActivity.! ! !SugarNavigatorBar methodsFor: 'sharing' stamp: 'bf 9/2/2008 15:57'! stopSharing SugarLauncher current leaveSharedActivity. listener ifNotNil: [listener stopListening. listener _ nil]. ActiveWorld remoteServer: nil. ActiveWorld submorphs do: [:e | (e isMemberOf: NebraskaServerMorph) ifTrue: [e delete]]. self sharingChanged.! ! SugarLauncher removeSelector: #share!