From aef5292567099e683e9342eca9507d6c43ae3d0b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 16 Feb 2022 17:19:00 +0100 Subject: [PATCH] Add handling of status code 333 This is used when something goes wrong with a MUC, e.g. a connection error made the MUC kick you out. In this case you generally want to try to rejoin. --- src/main/java/eu/siacs/conversations/entities/MucOptions.java | 1 + .../java/eu/siacs/conversations/parser/PresenceParser.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index d1f6525ce..34f437e1c 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -34,6 +34,7 @@ public class MucOptions { public static final String STATUS_CODE_AFFILIATION_CHANGE = "321"; public static final String STATUS_CODE_LOST_MEMBERSHIP = "322"; public static final String STATUS_CODE_SHUTDOWN = "332"; + public static final String STATUS_CODE_TECHNICAL_REASONS = "333"; private final Set users = new HashSet<>(); private final Conversation conversation; public OnRenameListener onRenameListener = null; diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index 9b3e38b3a..341e8d9a0 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -143,7 +143,9 @@ public class PresenceParser extends AbstractParser implements } else if (codes.contains(MucOptions.STATUS_CODE_SHUTDOWN) && fullJidMatches) { mucOptions.setError(MucOptions.Error.SHUTDOWN); } else if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)) { - if (codes.contains(MucOptions.STATUS_CODE_KICKED)) { + if (codes.contains(MucOptions.STATUS_CODE_TECHNICAL_REASONS)) { + mucOptions.setError(MucOptions.Error.UNKNOWN); + } else if (codes.contains(MucOptions.STATUS_CODE_KICKED)) { mucOptions.setError(MucOptions.Error.KICKED); } else if (codes.contains(MucOptions.STATUS_CODE_BANNED)) { mucOptions.setError(MucOptions.Error.BANNED);