[telepathy-python/master] Only delete the right channel in ChannelManager

Olivier Le Thanh Duong olivier at lethanh.be
Tue Jan 19 06:27:54 PST 2010


Only delete the right channel in ChannelManager.remove_channel instead
of deleting all the channels of the same type.
---
 src/server/channelmanager.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/server/channelmanager.py b/src/server/channelmanager.py
index 2d47604..e603c02 100644
--- a/src/server/channelmanager.py
+++ b/src/server/channelmanager.py
@@ -43,9 +43,8 @@ class ChannelManager(object):
     def remove_channel(self, channel):
         for channel_type in self._requestable_channel_classes:
             for handle, channels in self._channels[channel_type].items():
-                for chan in channels:
-                    if channel == chan:
-                        del self._channels[channel_type][handle]
+                if channel in channels :
+                    channels.remove(channel)
 
     def _get_type_requested_handle(self, props):
         type = props[CHANNEL_INTERFACE + '.ChannelType']
-- 
1.5.6.5




More information about the telepathy-commits mailing list