summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-09-10 18:27:42 -0400
committerLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-09-10 18:27:42 -0400
commita7d2c6866eef23fffa482f56c29eb638092641b3 (patch)
tree4ca5ed787bd79c1af8a9b1c48d7a65fa189a3aa0
parenteb2f00acba9c4be5ff57061b69df9a9551462659 (diff)
Fix capabilities detection
-rw-r--r--butterfly/capabilities.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/butterfly/capabilities.py b/butterfly/capabilities.py
index 0a0f9de..b46ad1e 100644
--- a/butterfly/capabilities.py
+++ b/butterfly/capabilities.py
@@ -131,12 +131,15 @@ class ButterflyCapabilities(
if channel_class[telepathy.CHANNEL_INTERFACE + '.ChannelType'] == \
telepathy.CHANNEL_TYPE_STREAMED_MEDIA:
video = True
- self._video_clients.append(client)
- else:
- # *Did* it used to support video?
- if client in self._video_clients:
- self._video_clients.remove(client)
+ break
+ if video and client not in self._video_clients:
+ self._video_clients.append(client)
+ elif not video and client in self._video_clients:
+ # *Did* it used to support video?
+ self._video_clients.remove(client)
+
+ video = (len(self._video_clients) > 0)
changed = False
# We've got no more clients that support video; remove the cap.
@@ -145,7 +148,8 @@ class ButterflyCapabilities(
changed = True
# We want video.
- if video and not self._self_handle.profile.client_id.has_webcam:
+ if video and (not self._self_handle.profile.client_id.has_webcam or
+ not self._self_handle.profile.client_id.supports_rtc_video):
self._self_handle.profile.client_id.has_webcam = True
self._self_handle.profile.client_id.supports_rtc_video = True
changed = True