diff options
-rw-r--r-- | src/server/channel.py | 3 | ||||
-rw-r--r-- | src/server/channelmanager.py | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/server/channel.py b/src/server/channel.py index 96ebb15..b5ee2b0 100644 --- a/src/server/channel.py +++ b/src/server/channel.py @@ -152,6 +152,9 @@ class ChannelTypeContactList(Channel, _ChannelTypeContactListIface): Channel.__init__(self, connection, manager, props, object_path=object_path) + def Close(self): + raise telepathy.NotImplemented("Contact lists can't be closed") + from telepathy._generated.Channel_Type_File_Transfer \ import ChannelTypeFileTransfer as _ChannelTypeFileTransferIface diff --git a/src/server/channelmanager.py b/src/server/channelmanager.py index 6e24e88..2752f3a 100644 --- a/src/server/channelmanager.py +++ b/src/server/channelmanager.py @@ -44,10 +44,15 @@ class ChannelManager(object): for channel_type in self._requestable_channels: for channels in self._channels[channel_type].values(): for channel in channels: - if channel._type == CHANNEL_TYPE_CONTACT_LIST: + try: + if channel._type != CHANNEL_TYPE_CONTACT_LIST: + channel.Close() + except: + pass + try: channel.remove_from_connection() - else: - channel.Close() + except: + pass def remove_channel(self, channel): "Remove channel from the channel manager" |