[telepathy-python/master] Fix registering new channels in channel manager

Olivier Le Thanh Duong olivier at lethanh.be
Wed Jan 20 03:03:43 PST 2010


Fix registering new channels in channel manager, thanks Edward Page for
noticing.
Checking for the handle to be in the dictionary  contradict using setdefault.
The handle never ends up in self._channels[type] and so the conditional always
fails so the channel never ends up being added to the list.
---
 src/server/channelmanager.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/server/channelmanager.py b/src/server/channelmanager.py
index 3d5f20a..7ebe241 100644
--- a/src/server/channelmanager.py
+++ b/src/server/channelmanager.py
@@ -92,8 +92,7 @@ class ChannelManager(object):
 
         self._conn.add_channels([channel], signal=signal)
         if type in self._channels:
-            if handle in self._channels[type]:
-                self._channels[type].setdefault(handle, []).append(channel)
+            self._channels[type].setdefault(handle, []).append(channel)
 
         return channel
 
-- 
1.5.6.5



More information about the telepathy-commits mailing list