Starting to add access to the debug log
[theonering] / src / channel_manager.py
index bce767b..04faca1 100644 (file)
@@ -17,6 +17,16 @@ class ChannelManager(tp.ChannelManager):
                tp.ChannelManager.__init__(self, connection)
 
                fixed = {
+                       telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_CONTACT_LIST
+               }
+               self._implement_channel_class(
+                       telepathy.CHANNEL_TYPE_CONTACT_LIST,
+                       self._get_list_channel,
+                       fixed,
+                       []
+               )
+
+               fixed = {
                        telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_TEXT,
                        telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)
                }
@@ -28,11 +38,12 @@ class ChannelManager(tp.ChannelManager):
                )
 
                fixed = {
-                       telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_CONTACT_LIST
+                       telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_FILE_TRANSFER,
+                       telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)
                }
                self._implement_channel_class(
-                       telepathy.CHANNEL_TYPE_CONTACT_LIST,
-                       self._get_list_channel,
+                       telepathy.CHANNEL_TYPE_FILE_TRANSFER,
+                       self._get_file_transfer_channel,
                        fixed,
                        []
                )
@@ -67,6 +78,13 @@ class ChannelManager(tp.ChannelManager):
                        chan = channel.text.TextChannel(self._conn, self, props, h)
                return chan
 
+       def _get_file_transfer_channel(self, props):
+               _, surpress_handler, h = self._get_type_requested_handle(props)
+
+               _moduleLogger.debug('New file transfer channel')
+               chan = channel.debug_log.DebugLogChannel(self._conn, self, props, h)
+               return chan
+
        def _get_media_channel(self, props):
                _, surpress_handler, h = self._get_type_requested_handle(props)