show server not found muc error

This commit is contained in:
Daniel Gultsch 2016-09-06 12:15:08 +02:00
parent 257d1e42d8
commit e1d2c32e63
4 changed files with 11 additions and 2 deletions

View File

@ -116,6 +116,7 @@ public class MucOptions {
public enum Error { public enum Error {
NO_RESPONSE, NO_RESPONSE,
SEVRER_NOT_FOUND,
NONE, NONE,
NICK_IN_USE, NICK_IN_USE,
PASSWORD_REQUIRED, PASSWORD_REQUIRED,

View File

@ -2028,8 +2028,12 @@ public class XmppConnectionService extends Service {
@Override @Override
public void onFetchFailed(final Conversation conversation, Element error) { public void onFetchFailed(final Conversation conversation, Element error) {
join(conversation); if (error != null && "remote-server-not-found".equals(error.getName())) {
fetchConferenceConfiguration(conversation); conversation.getMucOptions().setError(MucOptions.Error.SEVRER_NOT_FOUND);
} else {
join(conversation);
fetchConferenceConfiguration(conversation);
}
} }
}); });
updateConversationUi(); updateConversationUi();

View File

@ -865,6 +865,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
case NO_RESPONSE: case NO_RESPONSE:
showSnackbar(R.string.joining_conference, 0, null); showSnackbar(R.string.joining_conference, 0, null);
break; break;
case SEVRER_NOT_FOUND:
showSnackbar(R.string.remote_server_not_found,R.string.leave, leaveMuc);
break;
case PASSWORD_REQUIRED: case PASSWORD_REQUIRED:
showSnackbar(R.string.conference_requires_password, R.string.enter_password, enterPassword); showSnackbar(R.string.conference_requires_password, R.string.enter_password, enterPassword);
break; break;

View File

@ -680,4 +680,5 @@
<string name="contact_asks_for_presence_subscription">Contact asks for presence subscription</string> <string name="contact_asks_for_presence_subscription">Contact asks for presence subscription</string>
<string name="allow">Allow</string> <string name="allow">Allow</string>
<string name="no_permission_to_access_x">No permission to access %s</string> <string name="no_permission_to_access_x">No permission to access %s</string>
<string name="remote_server_not_found">Remote server not found</string>
</resources> </resources>