Skip to content

Commit

Permalink
Fix Collaboration
Browse files Browse the repository at this point in the history
  • Loading branch information
Saumya-Mishra9129 committed Aug 13, 2020
1 parent d8df3e6 commit f50d77e
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,11 @@ def __init__(self, handle):

self._open_reflect_windows()

def on_activity_joined_cb(me):
logging.debug('activity joined')

self.connect('joined', on_activity_joined_cb)

def on_activity_shared_cb(me):
logging.debug('activity shared')

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

self.collab = CollabWrapper(self)

self.collab.connect('shared', self._shared_cb)

if self.sharing:
# We're joining
if not self.get_shared():
self._label.set_label(_('Wait for the sharer to start.'))

self.collab.connect('message', self._message_cb)

self.collab.connect('joined', self._joined_cb)
Expand Down Expand Up @@ -726,18 +712,18 @@ def get_data(self):

def _shared_cb(self, activity):
''' Either set up initial share...'''
self.initiating = True
self._waiting_for_reflections = False
_logger.debug('I am sharing...')
self.sharing = True
self.after_share_join(True)

def _joined_cb(self, activity):
''' ...or join an exisiting share. '''
self.initiating = False
self._waiting_for_reflections = True
_logger.debug('I joined a shared activity.')
self.sharing = True
self.send_event(JOIN_CMD, {})
self.after_share_join(False)

def after_share_join(self, sharer):
self.initiating = sharer
self._waiting_for_reflections = not sharer
self._sharing = True
if self._waiting_for_reflections:
self.send_event(JOIN_CMD, {})

def _setup_dispatch_table(self):
self._processing_methods = {
Expand Down

0 comments on commit f50d77e

Please sign in to comment.