From 7b97fb294b48d52650f8e71c81ce9937e8c81290 Mon Sep 17 00:00:00 2001 From: Daniel Pocock Date: Fri, 8 Aug 2014 16:02:31 +0200 Subject: [PATCH] Avoid showing error popup if user clicks Yes in registration popup --- .../impl/protocol/sip/UriHandlerSipImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java index 49b2807fb..5aa1b0fbe 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java @@ -316,11 +316,15 @@ public void handleUri(String uri) { // make sure that we prompt for registration only if it is really // required by the provider. + boolean handled = false; if (exc.getErrorCode() == OperationFailedException.PROVIDER_NOT_REGISTERED) { - promptForRegistration(uri, provider); + handled = promptForRegistration(uri, provider); + } + if(!handled) + { + showErrorMessage("Failed to create a call to " + uri, exc); } - showErrorMessage("Failed to create a call to " + uri, exc); } catch (ParseException exc) { @@ -335,8 +339,9 @@ public void handleUri(String uri) * * @param uri the uri that the user would like us to call after registering. * @param provider the provider that we may have to reregister. + * @return true if user tried to start registration */ - private void promptForRegistration(String uri, + private boolean promptForRegistration(String uri, ProtocolProviderService provider) { int answer = @@ -351,7 +356,9 @@ private void promptForRegistration(String uri, if (answer == PopupDialog.YES_OPTION) { new ProtocolRegistrationThread(uri, provider).start(); + return true; } + return false; } /**