Making Async and Timeout callable
[theonering] / src / tp / channelmanager.py
index a2e6a27..4497c49 100644 (file)
@@ -1,6 +1,6 @@
 # telepathy-python - Base classes defining the interfaces of the Telepathy framework
 #
-# Copyright (C) 2009 Collabora Limited
+# Copyright (C) 2009-2010 Collabora Limited
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -22,7 +22,6 @@ from telepathy.interfaces import (CHANNEL_INTERFACE,
                                  CHANNEL_TYPE_CONTACT_LIST)
 
 class ChannelManager(object):
-
     def __init__(self, connection):
         self._conn = connection
 
@@ -93,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
 
@@ -116,6 +114,7 @@ class ChannelManager(object):
         self._available_properties[type] = available
 
     def get_requestable_channel_classes(self):
+        """Return all the channel types that can be created"""
         retval = []
 
         for channel_type in self._requestable_channel_classes: