import telepathy
import channel
+import util.misc as util_misc
_moduleLogger = logging.getLogger("channel_manager")
for channel_type in self._requestable_channel_classes:
for chan in self._channels[channel_type].values():
try:
- _moduleLogger.info("Closing %s %s" % (channel_type, chan._object_path))
+ _moduleLogger.debug("Closing %s %s" % (channel_type, chan._object_path))
chan.Close()
except Exception:
_moduleLogger.exception("Shutting down %r" % (chan, ))
)
def _get_list_channel(self, props):
- _, surpress_handler, handle = self._get_type_requested_handle(props)
+ _, surpress_handler, h = self._get_type_requested_handle(props)
_moduleLogger.debug('New contact list channel')
- chan = channel.contact_list.create_contact_list_channel(self._conn, self, props, handle)
+ chan = channel.contact_list.create_contact_list_channel(self._conn, self, props, h)
return chan
def _get_text_channel(self, props):
- _, surpress_handler, handle = self._get_type_requested_handle(props)
+ _, surpress_handler, h = self._get_type_requested_handle(props)
- _moduleLogger.debug('New text channel')
- chan = channel.text.TextChannel(self._conn, self, props, handle)
+ accountNumber = util_misc.strip_number(self._conn.session.backend.get_account_number())
+ if h.phoneNumber == accountNumber:
+ _moduleLogger.debug('New Debug channel')
+ chan = channel.debug_prompt.DebugPromptChannel(self._conn, self, props, h)
+ else:
+ _moduleLogger.debug('New text channel')
+ chan = channel.text.TextChannel(self._conn, self, props, h)
return chan
def _get_media_channel(self, props):
- _, surpress_handler, handle = self._get_type_requested_handle(props)
+ _, surpress_handler, h = self._get_type_requested_handle(props)
_moduleLogger.debug('New media channel')
- chan = channel.call.CallChannel(self._conn, self, props, handle)
+ chan = channel.call.CallChannel(self._conn, self, props, h)
return chan