Implement inviting buddies to a private activity

This commit is contained in:
Tomeu Vizoso
2010-07-08 17:20:51 +02:00
parent 37d7fc1075
commit fbee730549
5 changed files with 75 additions and 49 deletions
+5 -4
View File
@@ -694,22 +694,23 @@ class Activity(Window, gtk.Container):
def _send_invites(self):
while self._invites_queue:
buddy_key = self._invites_queue.pop()
buddy = self._pservice.get_buddy(buddy_key)
account_path, contact_id = self._invites_queue.pop()
pservice = presenceservice.get_instance()
buddy = pservice.get_buddy(account_path, contact_id)
if buddy:
self.shared_activity.invite(
buddy, '', self._invite_response_cb)
else:
logging.error('Cannot invite %s, no such buddy.', buddy_key)
def invite(self, buddy_key):
def invite(self, account_path, contact_id):
"""Invite a buddy to join this Activity.
Side Effects:
Calls self.share(True) to privately share the activity if it wasn't
shared before.
"""
self._invites_queue.append(buddy_key)
self._invites_queue.append((account_path, contact_id))
if (self.shared_activity is None
or not self.shared_activity.props.joined):
+2 -2
View File
@@ -67,8 +67,8 @@ class ActivityService(dbus.service.Object):
self._activity.props.active = active
@dbus.service.method(_ACTIVITY_INTERFACE)
def Invite(self, buddy_key):
self._activity.invite(buddy_key)
def Invite(self, account_path, contact_id):
self._activity.invite(account_path, contact_id)
@dbus.service.method(_ACTIVITY_INTERFACE)
def HandleViewSource(self):