X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fchannel_manager.py;h=5f609fe39d2d1e5f2c2c38c613fc0822e26c4bb6;hb=f26efb065490275f8b82b64a5ee12f40c820dd34;hp=dfff25907606bc77bc1f4e7d1d25d50366d885dd;hpb=ae58a0e7efd07fd97be2289c97cc2d3a53651ca9;p=theonering diff --git a/src/channel_manager.py b/src/channel_manager.py index dfff259..5f609fe 100644 --- a/src/channel_manager.py +++ b/src/channel_manager.py @@ -30,7 +30,7 @@ class ChannelManager(object): chan = self._listChannels[handle] except KeyError, e: if handle.get_type() != telepathy.HANDLE_TYPE_LIST: - raise RuntimeError("Unsupported channel type %r" % handle.get_type()) + raise telepathy.errors.NotImplemented("Only server lists are allowed") _moduleLogger.debug("Requesting new contact list channel") chan = channel.contact_list.create_contact_list_channel(self._connRef(), handle) @@ -43,11 +43,10 @@ class ChannelManager(object): chan = self._textChannels[handle] except KeyError, e: if handle.get_type() != telepathy.HANDLE_TYPE_CONTACT: - raise telepathy.NotImplemented("Only Contacts are allowed") + raise telepathy.errors.NotImplemented("Only Contacts are allowed") _moduleLogger.debug("Requesting new text channel") - contact = handle.contact - chan = channel.text.TextChannel(self._connRef()) + chan = channel.text.TextChannel(self._connRef(), handle) self._textChannels[handle] = chan self._connRef().add_channel(chan, handle, suppress_handler) return chan @@ -56,12 +55,11 @@ class ChannelManager(object): try: chan = self._callChannels[handle] except KeyError, e: - if handle.get_type() != telepathy.HANDLE_TYPE_CONTACT: - raise telepathy.NotImplemented("Only Contacts are allowed") + if handle.get_type() != telepathy.HANDLE_TYPE_NONE: + raise telepathy.errors.NotImplemented("Using deprecated means to create a call") _moduleLogger.debug("Requesting new call channel") - contact = handle.contact - chan = channel.call.CallChannel(self._connRef()) + chan = channel.call.CallChannel(self._connRef(), handle) self._callChannels[handle] = chan self._connRef().add_channel(chan, handle, suppress_handler) return chan