--- ./Smack-4.4.0-alpha3-20190916/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java	2019-09-18 15:59:57.000000000 
+++ ./src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java	2020-03-21 17:45:43.000000000 
@@ -252,14 +252,25 @@
                                 checkPresenceCode(
                                     mucUser.getStatus(),
                                     presence.getFrom().equals(myRoomJID),
                                     mucUser,
                                     from);
                             } else {
+                                // The room has been destroyed.
+                                if (mucUser != null && mucUser.getDestroy() != null) {
+                                    // Reset occupant information.
+                                    userHasLeft();
+                                    myRoomJid = null;
+
+                                    MultiUserChat alternateMUC = multiUserChatManager.getMultiUserChat(mucUser.getDestroy().getJid());
+                                    for (UserStatusListener listener : userStatusListeners) {
+                                        listener.roomDestroyed(alternateMUC, mucUser.getDestroy().getReason());
+                                    }
+                                }
                                 // An occupant has left the room
-                                if (!isUserStatusModification) {
+                                else if (!isUserStatusModification) {
                                     for (ParticipantStatusListener listener : participantStatusListeners) {
                                         listener.left(from);
                                     }
                                 }
                             }
                             break;
@@ -979,14 +990,14 @@
         return invitationRejectionListeners.remove(listener);
     }
 
     /**
      * Fires invitation rejection listeners.
      *
-     * @param invitee the user being invited.
-     * @param reason the reason for the rejection
+     * @param message the message to use for sending the rejection.
+     * @param rejection the raw decline found in the message
      */
     private void fireInvitationRejectionListeners(Message message, MUCUser.Decline rejection) {
         EntityBareJid invitee = rejection.getFrom();
         String reason = rejection.getReason();
         InvitationRejectionListener[] listeners;
         synchronized (invitationRejectionListeners) {
@@ -2374,12 +2385,13 @@
      */
     private void checkPresenceCode(
         Set<Status> statusCodes,
         boolean isUserModification,
         MUCUser mucUser,
         EntityFullJid from) {
+
         // Check if an occupant was kicked from the room
         if (statusCodes.contains(Status.KICKED_307)) {
             // Check if this occupant was kicked
             if (isUserModification) {
                 // Reset occupant information.
                 userHasLeft();
@@ -2395,60 +2407,46 @@
             }
         }
         // A user was banned from the room
         if (statusCodes.contains(Status.BANNED_301)) {
             // Check if this occupant was banned
             if (isUserModification) {
-                joined = false;
+                // Reset occupant information.
+                userHasLeft();
+                myRoomJid = null;
+
                 for (UserStatusListener listener : userStatusListeners) {
                     listener.banned(mucUser.getItem().getActor(), mucUser.getItem().getReason());
                 }
 
-                // Reset occupant information.
-                occupantsMap.clear();
-                myRoomJid = null;
-                userHasLeft();
             }
             else {
                 for (ParticipantStatusListener listener : participantStatusListeners) {
                     listener.banned(from, mucUser.getItem().getActor(), mucUser.getItem().getReason());
                 }
             }
         }
         // A user's membership was revoked from the room
         if (statusCodes.contains(Status.REMOVED_AFFIL_CHANGE_321)) {
             // Check if this occupant's membership was revoked
             if (isUserModification) {
-                joined = false;
+                // Reset occupant information.
+                userHasLeft();
+                myRoomJid = null;
+
                 for (UserStatusListener listener : userStatusListeners) {
                     listener.membershipRevoked();
                 }
 
-                // Reset occupant information.
-                occupantsMap.clear();
-                myRoomJid = null;
-                userHasLeft();
             }
         }
         // A occupant has changed his nickname in the room
         if (statusCodes.contains(Status.NEW_NICKNAME_303)) {
             for (ParticipantStatusListener listener : participantStatusListeners) {
                 listener.nicknameChanged(from, mucUser.getItem().getNick());
             }
-        }
-        // The room has been destroyed.
-        if (mucUser.getDestroy() != null) {
-            MultiUserChat alternateMUC = multiUserChatManager.getMultiUserChat(mucUser.getDestroy().getJid());
-            for (UserStatusListener listener : userStatusListeners) {
-                listener.roomDestroyed(alternateMUC, mucUser.getDestroy().getReason());
-            }
-
-            // Reset occupant information.
-            occupantsMap.clear();
-            myRoomJid = null;
-            userHasLeft();
         }
     }
 
     /**
      * Get the XMPP connection associated with this chat instance.
      *
