Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Collett <morgan.collett@collabora.co.uk>2007-06-11 18:58:58 (GMT)
committer Morgan Collett <morgan.collett@collabora.co.uk>2007-06-11 18:58:58 (GMT)
commit7e28027c43ec32e65cc73e06d847d367dfb7ccb3 (patch)
treef31fe427c7bcb9266d31c1f375ec405e7041b867
parent8599688f1b0306817064cadc38af53e75735e4b3 (diff)
Get the Tubes working
-rw-r--r--activity.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/activity.py b/activity.py
index 25c8753..4899b4a 100644
--- a/activity.py
+++ b/activity.py
@@ -29,6 +29,10 @@ from sugar.presence import presenceservice
# will eventually be imported from telepathy.tubes or something
from tubeconn import TubeConnection
+SERVICE = "org.laptop.HelloMesh"
+IFACE = SERVICE
+PATH = "/org/laptop/HelloMesh"
+
logger = logging.getLogger('hellomesh-activity')
class HelloMeshActivity(Activity):
@@ -155,9 +159,6 @@ class HelloMeshActivity(Activity):
logger.error('ListTubes() failed: %s', e)
def _joined_cb(self, activity):
- if self.game is not None:
- return
-
if not self._shared_activity:
return
@@ -178,16 +179,14 @@ class HelloMeshActivity(Activity):
'params=%r state=%d', id, initiator, type, service,
params, state)
- #if (self.game is None and type == telepathy.TUBE_TYPE_DBUS and
- # service == SERVICE):
- # if state == telepathy.TUBE_STATE_LOCAL_PENDING:
- # self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].AcceptTube(id)
+ if (type == telepathy.TUBE_TYPE_DBUS and
+ service == SERVICE):
+ if state == telepathy.TUBE_STATE_LOCAL_PENDING:
+ self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].AcceptTube(id)
- # tube_conn = TubeConnection(self.conn,
- # self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES],
- # id, group_iface=self.text_chan[telepathy.CHANNEL_INTERFACE_GROUP])
- # self.game = ConnectGame(tube_conn, self.grid, self.initiating,
- # self.buddies_panel, self.owner, self._get_buddy, self)
+ tube_conn = TubeConnection(self.conn,
+ self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES],
+ id, group_iface=self.text_chan[telepathy.CHANNEL_INTERFACE_GROUP])
def _buddy_joined_cb (self, activity, buddy):
logger.debug('Buddy %s joined' % buddy.props.nick)