From 78ee3d2b20d11f76621368fcdc61009a1db0aff0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Jun 2006 21:17:58 -0400 Subject: [PATCH] Find chat service that may have already been resolved, and make sure we don't user services that aren't for our activity --- sugar/chat/GroupChat.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sugar/chat/GroupChat.py b/sugar/chat/GroupChat.py index 97b32dc9..d9e723e5 100644 --- a/sugar/chat/GroupChat.py +++ b/sugar/chat/GroupChat.py @@ -18,11 +18,15 @@ class GroupChat(Chat): self._pservice.start() self._pservice.connect('service-appeared', self._service_appeared_cb) self._pservice.track_service_type(GroupChat.SERVICE_TYPE) + service = self._pservice.get_activity_service(activity, GroupChat.SERVICE_TYPE) + if service is not None: + self._service_appeared(self._pservice, None, service) def _service_appeared_cb(self, pservice, buddy, service): - if service.get_full_type() == GroupChat.SERVICE_TYPE: - logging.debug('Group chat service appeared, setup the stream.') - self._setup_stream(service) + if service.get_activity_uid() == self._activity.get_id(): + if service.get_type() == GroupChat.SERVICE_TYPE: + logging.debug('Group chat service appeared, setup the stream.') + self._setup_stream(service) def publish(self): service = self._pservice.share_activity(self._activity,