show snackbar for resource constraint in mucs

This commit is contained in:
Daniel Gultsch 2018-07-07 10:28:31 +02:00
parent a1f933924c
commit 0fa97bdc11
4 changed files with 7 additions and 0 deletions

View File

@ -139,6 +139,7 @@ public class MucOptions {
PASSWORD_REQUIRED, PASSWORD_REQUIRED,
BANNED, BANNED,
MEMBERS_ONLY, MEMBERS_ONLY,
RESOURCE_CONSTRAINT,
KICKED, KICKED,
SHUTDOWN, SHUTDOWN,
INVALID_NICK, INVALID_NICK,

View File

@ -166,6 +166,8 @@ public class PresenceParser extends AbstractParser implements
mucOptions.setError(MucOptions.Error.BANNED); mucOptions.setError(MucOptions.Error.BANNED);
} else if (error.hasChild("registration-required")) { } else if (error.hasChild("registration-required")) {
mucOptions.setError(MucOptions.Error.MEMBERS_ONLY); mucOptions.setError(MucOptions.Error.MEMBERS_ONLY);
} else if (error.hasChild("resource-constraint")) {
mucOptions.setError(MucOptions.Error.RESOURCE_CONSTRAINT);
} else { } else {
final String text = error.findChildContent("text"); final String text = error.findChildContent("text");
if (text != null && text.contains("attribute 'to'")) { if (text != null && text.contains("attribute 'to'")) {

View File

@ -2014,6 +2014,9 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
case MEMBERS_ONLY: case MEMBERS_ONLY:
showSnackbar(R.string.conference_members_only, R.string.leave, leaveMuc); showSnackbar(R.string.conference_members_only, R.string.leave, leaveMuc);
break; break;
case RESOURCE_CONSTRAINT:
showSnackbar(R.string.conference_resource_constraint, R.string.try_again, joinMuc);
break;
case KICKED: case KICKED:
showSnackbar(R.string.conference_kicked, R.string.join, joinMuc); showSnackbar(R.string.conference_kicked, R.string.join, joinMuc);
break; break;

View File

@ -284,6 +284,7 @@
<string name="toast_message_omemo_fingerprint">OMEMO fingerprint copied to clipboard!</string> <string name="toast_message_omemo_fingerprint">OMEMO fingerprint copied to clipboard!</string>
<string name="conference_banned">You are banned from this group chat</string> <string name="conference_banned">You are banned from this group chat</string>
<string name="conference_members_only">This group chat is members only</string> <string name="conference_members_only">This group chat is members only</string>
<string name="conference_resource_constraint">Resource constraint</string>
<string name="conference_kicked">You have been kicked from this group chat</string> <string name="conference_kicked">You have been kicked from this group chat</string>
<string name="conference_shutdown">The group chat was shut down</string> <string name="conference_shutdown">The group chat was shut down</string>
<string name="conference_unknown_error">You are no longer in this group chat</string> <string name="conference_unknown_error">You are no longer in this group chat</string>