From cc0e89390293456dbb2f41ed70cf41276d532ee6 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Mon, 29 May 2023 11:58:24 +0200 Subject: [PATCH] Improve error message when failing to join MUC When joining a MUC fails, an error message is shown. That message should include a reference to the server that is causing the error. --- .../jivesoftware/spark/ui/conferences/ConferenceUtils.java | 4 +++- .../spark/ui/conferences/JoinRoomSwingWorker.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/jivesoftware/spark/ui/conferences/ConferenceUtils.java b/core/src/main/java/org/jivesoftware/spark/ui/conferences/ConferenceUtils.java index 74ea0cd0f..f2ad0b5ae 100644 --- a/core/src/main/java/org/jivesoftware/spark/ui/conferences/ConferenceUtils.java +++ b/core/src/main/java/org/jivesoftware/spark/ui/conferences/ConferenceUtils.java @@ -203,7 +203,9 @@ public static List joinRoom(MultiUserChat groupChat, Resourcepart nickna error = ( (XMPPException.XMPPErrorException) ex ).getStanzaError(); } - final String errorText = ConferenceUtils.getReason( error ); + String errorText = Res.getString("title.join.conference.room"); + if (groupChat.getRoom() != null) { errorText += " " + groupChat.getRoom(); } + errorText += ": " + ConferenceUtils.getReason( error ); errors.add( errorText ); } } diff --git a/core/src/main/java/org/jivesoftware/spark/ui/conferences/JoinRoomSwingWorker.java b/core/src/main/java/org/jivesoftware/spark/ui/conferences/JoinRoomSwingWorker.java index 4c21f8c3b..1f022ec36 100644 --- a/core/src/main/java/org/jivesoftware/spark/ui/conferences/JoinRoomSwingWorker.java +++ b/core/src/main/java/org/jivesoftware/spark/ui/conferences/JoinRoomSwingWorker.java @@ -206,7 +206,10 @@ public Object construct() } } - final String errorText = ConferenceUtils.getReason( error ); + String errorText = Res.getString("title.join.conference.room"); + errorText += " " + roomJID; + errorText += ": " + ConferenceUtils.getReason( error ); + errors.add( errorText ); return null; }