aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-07-09 22:17:01 +0200
committerChristian Schneppe <christian@pix-art.de>2018-07-09 22:17:01 +0200
commit3087a62410d8128dac82fec47d36417376714e3b (patch)
tree550a0478929a4382668a934c8f809e29af7c157e
parent779dc182a302a7891ee7a6ad1426b9337c655a27 (diff)
show snackbar for resource constraint in mucs
-rw-r--r--src/main/java/de/pixart/messenger/entities/MucOptions.java1
-rw-r--r--src/main/java/de/pixart/messenger/parser/PresenceParser.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java3
-rw-r--r--src/main/res/values/strings.xml1
4 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java
index 27b318f0c..47ca622fc 100644
--- a/src/main/java/de/pixart/messenger/entities/MucOptions.java
+++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java
@@ -139,6 +139,7 @@ public class MucOptions {
PASSWORD_REQUIRED,
BANNED,
MEMBERS_ONLY,
+ RESOURCE_CONSTRAINT,
KICKED,
SHUTDOWN,
INVALID_NICK,
diff --git a/src/main/java/de/pixart/messenger/parser/PresenceParser.java b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
index f3ca0e747..3b6b83fd4 100644
--- a/src/main/java/de/pixart/messenger/parser/PresenceParser.java
+++ b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
@@ -162,6 +162,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'")) {
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index a22b775b3..4ec01434d 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -2330,6 +2330,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;
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 95f23cf2a..a04d2c9ee 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -802,4 +802,5 @@
<string name="providing_a_name_is_optional">Providing a name is optional</string>
<string name="create_dialog_group_chat_name">Group chat name</string>
<string name="everyone_has_read_up_to_this_point">Everyone has read up to this point</string>
+ <string name="conference_resource_constraint">Resource constraint</string>
</resources>