PresenceParser: work around for ejabberd not including status code 110 in shut down presence

This commit is contained in:
Daniel Gultsch 2017-11-30 13:21:03 +01:00
parent 21480c9b98
commit 86f09dd9b9
2 changed files with 5 additions and 3 deletions

View file

@ -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)) {

View file

@ -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();