Find chat service that may have already been resolved, and make sure we don't user services that aren't for our activity

This commit is contained in:
Dan Williams 2006-06-19 21:17:58 -04:00
parent 6fd464be7d
commit 78ee3d2b20

View File

@ -18,9 +18,13 @@ class GroupChat(Chat):
self._pservice.start() self._pservice.start()
self._pservice.connect('service-appeared', self._service_appeared_cb) self._pservice.connect('service-appeared', self._service_appeared_cb)
self._pservice.track_service_type(GroupChat.SERVICE_TYPE) 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): def _service_appeared_cb(self, pservice, buddy, service):
if service.get_full_type() == GroupChat.SERVICE_TYPE: 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.') logging.debug('Group chat service appeared, setup the stream.')
self._setup_stream(service) self._setup_stream(service)