Hookup the new invites implementation. Need to fix
the frame view since that's bitrotten.
This commit is contained in:
parent
e5db6eb971
commit
0d4d74b94f
@ -66,6 +66,8 @@ class ShellOwner(gobject.GObject):
|
|||||||
self._icon_hash = util.printable_hash(digest)
|
self._icon_hash = util.printable_hash(digest)
|
||||||
|
|
||||||
self._pservice = presenceservice.get_instance()
|
self._pservice = presenceservice.get_instance()
|
||||||
|
self._pservice.connect('activity-invitation',
|
||||||
|
self._activity_invitation_cb)
|
||||||
|
|
||||||
self._invites = Invites()
|
self._invites = Invites()
|
||||||
|
|
||||||
@ -75,7 +77,6 @@ class ShellOwner(gobject.GObject):
|
|||||||
def get_nick(self):
|
def get_nick(self):
|
||||||
return self._nick
|
return self._nick
|
||||||
|
|
||||||
def _handle_invite(self, issuer, bundle_id, activity_id):
|
def _activity_invitation_cb(self, pservice, activity, buddy, message):
|
||||||
"""XMLRPC method, called when the owner is invited to an activity."""
|
self._invites.add_invite(buddy, activity.props.type,
|
||||||
self._invites.add_invite(issuer, bundle_id, activity_id)
|
activity.props.id)
|
||||||
return ''
|
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import dbus
|
import dbus
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from sugar.presence import presenceservice
|
||||||
|
|
||||||
import OverlayWindow
|
import OverlayWindow
|
||||||
|
|
||||||
@ -62,7 +65,15 @@ class ActivityHost:
|
|||||||
return self._model
|
return self._model
|
||||||
|
|
||||||
def invite(self, buddy):
|
def invite(self, buddy):
|
||||||
pass
|
pservice = presenceservice.get_instance()
|
||||||
|
activity = pservice.get_activity(self.get_id())
|
||||||
|
if activity is None:
|
||||||
|
logging.error('Invite failed, %s is unknown.' % self.get_id())
|
||||||
|
activity.invite(buddy.get_buddy(), '', self._invite_response_cb)
|
||||||
|
|
||||||
|
def _invite_response_cb(self, error):
|
||||||
|
if error:
|
||||||
|
logging.error('Invite failed: %s' % error)
|
||||||
|
|
||||||
def present(self):
|
def present(self):
|
||||||
# wnck.Window.activate() expects a timestamp, but we don't
|
# wnck.Window.activate() expects a timestamp, but we don't
|
||||||
|
Loading…
Reference in New Issue
Block a user