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,
BANNED,
MEMBERS_ONLY,
RESOURCE_CONSTRAINT,
KICKED,
SHUTDOWN,
INVALID_NICK,

View file

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

View file

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

View file

@ -284,6 +284,7 @@
<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_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_shutdown">The group chat was shut down</string>
<string name="conference_unknown_error">You are no longer in this group chat</string>