Implement inviting buddies to a private activity
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user