diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-12-01 21:50:23 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-12-01 21:50:23 +0100 |
commit | d599b04ac3639da781062069a64fac68861f671d (patch) | |
tree | d05a1b6b1227ae716e17efd4ca0630b197a5163c | |
parent | ffd61bf7d04ab2691ff55df26bd79d1b5c31b0b0 (diff) |
PresenceParser: work around for ejabberd not including status code 110 in shut down presence
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/PresenceParser.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/PresenceParser.java b/src/main/java/de/pixart/messenger/parser/PresenceParser.java index e46947304..2bb7e6aac 100644 --- a/src/main/java/de/pixart/messenger/parser/PresenceParser.java +++ b/src/main/java/de/pixart/messenger/parser/PresenceParser.java @@ -113,7 +113,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/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 57f4bf45a..21d1953bc 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -1142,10 +1142,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa break; case UNKNOWN: activity.xmppConnectionService.joinMuc(conversation); - //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(); |