aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2017-11-30 13:21:03 +0100
committerDaniel Gultsch <daniel@gultsch.de>2017-11-30 13:21:03 +0100
commit86f09dd9b9d9788e1b935dbb56fdac44277088f3 (patch)
tree47e2d85d60c97437d8c85e7a679cfb6684139a0c
parent21480c9b9819f6e58da2db355d0f61713462c9b7 (diff)
PresenceParser: work around for ejabberd not including status code 110 in shut down presence
-rw-r--r--src/main/java/eu/siacs/conversations/parser/PresenceParser.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
index 972ac5f..eec6bd1 100644
--- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
@@ -115,7 +115,9 @@ public class PresenceParser extends AbstractParser implements
}
}
} else if (type.equals("unavailable")) {
- if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)) {
+ if (codes.contains(MucOptions.STATUS_CODE_SHUTDOWN) && from.equals(mucOptions.getSelf().getFullJid())) {
+ mucOptions.setError(MucOptions.Error.SHUTDOWN);
+ } else if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)) {
if (codes.contains(MucOptions.STATUS_CODE_KICKED)) {
mucOptions.setError(MucOptions.Error.KICKED);
} else if (codes.contains(MucOptions.STATUS_CODE_BANNED)) {
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 5af7955..4dd7f84 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -1107,10 +1107,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
showSnackbar(R.string.conference_kicked, R.string.join, joinMuc);
break;
case UNKNOWN:
- showSnackbar(R.string.conference_unknown_error, R.string.join, joinMuc);
+ showSnackbar(R.string.conference_unknown_error, R.string.try_again, joinMuc);
break;
case SHUTDOWN:
- showSnackbar(R.string.conference_shutdown, R.string.join, joinMuc);
+ showSnackbar(R.string.conference_shutdown, R.string.try_again, joinMuc);
break;
default:
hideSnackbar();