Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/model/Invites.py
diff options
context:
space:
mode:
Diffstat (limited to 'shell/model/Invites.py')
-rw-r--r--shell/model/Invites.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/model/Invites.py b/shell/model/Invites.py
index d4779f1..9ffab44 100644
--- a/shell/model/Invites.py
+++ b/shell/model/Invites.py
@@ -15,6 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import gobject
+from sugar.presence import presenceservice
class Invite:
def __init__(self, issuer, bundle_id, activity_id):
@@ -41,6 +42,10 @@ class Invites(gobject.GObject):
self._dict = {}
+ ps = presenceservice.get_instance()
+ owner = ps.get_owner()
+ owner.connect('joined-activity', self._owner_joined_cb)
+
def add_invite(self, issuer, bundle_id, activity_id):
if activity_id in self._dict:
# there is no point to add more than one time
@@ -60,5 +65,8 @@ class Invites(gobject.GObject):
if invite is not None:
self.remove_invite(invite)
+ def _owner_joined_cb(self, owner, activity):
+ self.remove_activity(activity.props.id)
+
def __iter__(self):
return self._dict.values().__iter__()