How do I know if my activity is being started anew or started after someone invites me?

Asked by Thomas Jourdan

How do I know if my activity is being started anew or started after someone invites me?

In both cases the activity is started from home view, not journal. The difference is when my activity is started anew it produces its own data model. But when started in case of invention the data model will be send later from the inviting buddy.

How can I find out inside the constructor of "class MyActivity(activity.Activity):" when the user starts my activity due to an invention?

Question information

Language:
English Edit question
Status:
Solved
For:
Sugar on a Stick Edit question
Assignee:
No assignee Edit question
Solved by:
Thomas Jourdan
Solved:
Last query:
Last reply:
Revision history for this message
James Cameron (quozl) said :
#1

I don't know ... but you could also ask this question on #sugar IRC
channel or the Sugar development mailing lists.

--
James Cameron
http://quozl.linux.org.au/

Revision history for this message
walterbender (walter-sugarlabs) said :
#2

This question is general to Sugar, not just Sugar on a stick. I use the following logic and the appropriate callback is invoked when you are either the initiator or joining.

        """
        A simplistic sharing model: the sharer is the master;
        """
        # Get the Presence Service
        self.pservice = presenceservice.get_instance()
        self.initiating = None # sharing (True) or joining (False)

        # Add my buddy object to the list
        owner = self.pservice.get_owner()
        self.owner = owner
        self.tw.buddies.append(self.owner)
        self._share = ""

        self.connect('shared', self._shared_cb)
        self.connect('joined', self._joined_cb)

Revision history for this message
Thomas Jourdan (b-vehikel) said :
#3

Ok, to solve this issue I must reorganize my code.