Change summary
src/main/java/eu/siacs/conversations/entities/MucOptions.java | 1
src/main/java/eu/siacs/conversations/parser/PresenceParser.java | 2
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 7 +
src/main/res/values/strings.xml | 1
4 files changed, 11 insertions(+)
Detailed changes
@@ -644,6 +644,7 @@ public class MucOptions {
public enum Error {
NO_RESPONSE,
SERVER_NOT_FOUND,
+ REMOTE_SERVER_TIMEOUT,
NONE,
NICK_IN_USE,
PASSWORD_REQUIRED,
@@ -188,6 +188,8 @@ public class PresenceParser extends AbstractParser implements
mucOptions.setError(MucOptions.Error.MEMBERS_ONLY);
} else if (error.hasChild("resource-constraint")) {
mucOptions.setError(MucOptions.Error.RESOURCE_CONSTRAINT);
+ } else if (error.hasChild("remote-server-timeout")) {
+ mucOptions.setError(MucOptions.Error.REMOTE_SERVER_TIMEOUT);
} else if (error.hasChild("gone")) {
final String gone = error.findChildContent("gone");
final Jid alternate;
@@ -2111,6 +2111,13 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
showSnackbar(R.string.remote_server_not_found, R.string.leave, leaveMuc);
}
break;
+ case REMOTE_SERVER_TIMEOUT:
+ if (conversation.receivedMessagesCount() > 0) {
+ showSnackbar(R.string.remote_server_timeout, R.string.try_again, joinMuc);
+ } else {
+ showSnackbar(R.string.remote_server_timeout, R.string.leave, leaveMuc);
+ }
+ break;
case PASSWORD_REQUIRED:
showSnackbar(R.string.conference_requires_password, R.string.enter_password, enterPassword);
break;
@@ -561,6 +561,7 @@
<string name="allow">Allow</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>
+ <string name="remote_server_timeout">Remote server timeout</string>
<string name="unable_to_update_account">Unable to update account</string>
<string name="report_jid_as_spammer">Report this JID as sending unwanted messages.</string>
<string name="pref_delete_omemo_identities">Delete OMEMO identities</string>