Show appropriate notification when user not found is returned.

cusax-fix
Damian Minkov 16 years ago
parent b39c7b186b
commit dc6ba59ed8

@ -939,10 +939,17 @@ else if ( response.getStatusCode() >= 400 )
{
logger.error("Received an error response.");
int registrationStateReason =
RegistrationStateChangeEvent.REASON_NOT_SPECIFIED;
if(response.getStatusCode() == Response.NOT_FOUND)
registrationStateReason =
RegistrationStateChangeEvent.REASON_NON_EXISTING_USER_ID;
//tell the others we couldn't register
this.setRegistrationState(
RegistrationState.CONNECTION_FAILED
, RegistrationStateChangeEvent.REASON_NOT_SPECIFIED
, registrationStateReason
, "Received an error while trying to register. "
+ "Server returned error:" + response.getReasonPhrase()
);

@ -574,13 +574,25 @@ public synchronized void registrationStateChanged(RegistrationStateChangeEvent e
{
// ignore providers which haven't registered successfully
// till now, they maybe misconfigured
// todo show dialog
notify(
getResources().getI18NString("service.gui.ERROR"),
"plugin.reconnectplugin.CONNECTION_FAILED_MSG",
new String[]
{ pp.getAccountID().getUserID(),
pp.getAccountID().getService() });
String notifyMsg;
if(evt.getReasonCode() ==
RegistrationStateChangeEvent.REASON_NON_EXISTING_USER_ID)
{
notify(
getResources().getI18NString("service.gui.ERROR"),
"service.gui.NON_EXISTING_USER_ID",
new String[]{pp.getAccountID().getService()});
}
else
{
notify(
getResources().getI18NString("service.gui.ERROR"),
"plugin.reconnectplugin.CONNECTION_FAILED_MSG",
new String[]
{ pp.getAccountID().getUserID(),
pp.getAccountID().getService() });
}
return;
}

Loading…
Cancel
Save