diff options
author | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-10-22 14:23:01 -0400 |
---|---|---|
committer | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-12-03 10:55:42 -0500 |
commit | 4e3d98900b9d9574d08588476a186a85d2aa9667 (patch) | |
tree | edc8c29f84178fb5a07acd4923e01b4a44854be7 | |
parent | 9fda86d8b94e840361164d48b93b64b8b99af0b7 (diff) |
Remove Channel D-Bus object from the connection if Close failed
-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" |