Avoid showing error popup if user clicks Yes in registration popup

fix-message-formatting
Daniel Pocock 11 years ago
parent 4d97b7349b
commit 7b97fb294b

@ -316,11 +316,15 @@ public void handleUri(String uri)
{ {
// make sure that we prompt for registration only if it is really // make sure that we prompt for registration only if it is really
// required by the provider. // required by the provider.
boolean handled = false;
if (exc.getErrorCode() == OperationFailedException.PROVIDER_NOT_REGISTERED) 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) 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 uri the uri that the user would like us to call after registering.
* @param provider the provider that we may have to reregister. * @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) ProtocolProviderService provider)
{ {
int answer = int answer =
@ -351,7 +356,9 @@ private void promptForRegistration(String uri,
if (answer == PopupDialog.YES_OPTION) if (answer == PopupDialog.YES_OPTION)
{ {
new ProtocolRegistrationThread(uri, provider).start(); new ProtocolRegistrationThread(uri, provider).start();
return true;
} }
return false;
} }
/** /**

Loading…
Cancel
Save