Always remove invites from the frame

Conflicts:

	NEWS
This commit is contained in:
Marco Pesenti Gritti 2007-09-19 19:20:40 +02:00
parent c6459583ee
commit c74276dcdb
2 changed files with 12 additions and 0 deletions

4
NEWS
View File

@ -1,3 +1,7 @@
* #3601 Always remove invites from the frame. (cassidy)
Snapshot b8ce5083b7
* #3560 Updated spanish translation. (marco)
Snapshot b8ce5083b7

View File

@ -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__()