Always remove invites from the frame
Conflicts: NEWS
This commit is contained in:
@@ -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__()
|
||||
|
||||
Reference in New Issue
Block a user