mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-2372: Async chat leave
The ‘leave chat’ event can be executed asynchronously, so that the UI isn’t needlessly waiting for things.
This commit is contained in:
@ -46,6 +46,7 @@ import org.jivesoftware.spark.ui.conferences.ConferenceUtils;
|
||||
import org.jivesoftware.spark.ui.conferences.DataFormDialog;
|
||||
import org.jivesoftware.spark.ui.conferences.GroupChatParticipantList;
|
||||
import org.jivesoftware.spark.util.ModelUtil;
|
||||
import org.jivesoftware.spark.util.SwingWorker;
|
||||
import org.jivesoftware.spark.util.UIComponentRegistry;
|
||||
import org.jivesoftware.spark.util.log.Log;
|
||||
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
|
||||
@ -543,14 +544,13 @@ public class GroupChatRoom extends ChatRoom
|
||||
// Update Room Notice To Inform Agent that he has left the chat.
|
||||
getTranscriptWindow().insertNotificationMessage( Res.getString( "message.user.left.room", getNickname() ), ChatManager.NOTIFICATION_COLOR );
|
||||
|
||||
try
|
||||
{
|
||||
chat.leave();
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
Log.error( "Closing Group Chat Room error.", e );
|
||||
}
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
try {
|
||||
chat.leave();
|
||||
} catch ( Exception e ) {
|
||||
Log.error( "Closing Group Chat Room error.", e );
|
||||
}
|
||||
});
|
||||
|
||||
// Set window as greyed out.
|
||||
getTranscriptWindow().showWindowDisabled();
|
||||
|
||||
Reference in New Issue
Block a user