- try:
- self.check_parameters(parameters)
- account = unicode(parameters['username'])
-
- # Connection init must come first
- telepathy.server.Connection.__init__(
- self,
- constants._telepathy_protocol_name_,
- account,
- constants._telepathy_implementation_name_
- )
- aliasing.AliasingMixin.__init__(self)
- simple_presence.SimplePresenceMixin.__init__(self)
-
- self._manager = weakref.proxy(manager)
- self._credentials = (
- parameters['username'].encode('utf-8'),
- parameters['password'].encode('utf-8'),
- )
- self._callbackNumber = parameters['forward'].encode('utf-8')
- self._channelManager = channel_manager.ChannelManager(self)
+ self.check_parameters(parameters)
+ account = unicode(parameters['account'])
+ encodedAccount = parameters['account'].encode('utf-8')
+ encodedPassword = parameters['password'].encode('utf-8')
+ encodedCallback = parameters['forward'].encode('utf-8')
+ if not encodedCallback:
+ raise telepathy.errors.InvalidArgument("User must specify what number GV forwards calls to")
+
+ # Connection init must come first
+ telepathy.server.Connection.__init__(
+ self,
+ constants._telepathy_protocol_name_,
+ account,
+ constants._telepathy_implementation_name_
+ )
+ aliasing.AliasingMixin.__init__(self)
+ simple_presence.SimplePresenceMixin.__init__(self)
+ presence.PresenceMixin.__init__(self)
+ capabilities.CapabilitiesMixin.__init__(self)
+
+ self._manager = weakref.proxy(manager)
+ self._credentials = (
+ encodedAccount,
+ encodedPassword,
+ )
+ self._callbackNumber = encodedCallback
+ self._channelManager = channel_manager.ChannelManager(self)