1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-29 17:52:06 +01:00

Call MultiUserChat.userHasLeft() before invoking listeners

in case a listener throws, userHasLeft() will eventually have set the
MutliUserChat instance to the right state.
This commit is contained in:
Florian Schmaus 2017-11-07 20:15:15 +01:00
parent d93d214f0e
commit 0a4cd79d4e

View file

@ -2338,12 +2338,12 @@ public class MultiUserChat {
if (statusCodes.contains(Status.KICKED_307)) { if (statusCodes.contains(Status.KICKED_307)) {
// Check if this occupant was kicked // Check if this occupant was kicked
if (isUserModification) { if (isUserModification) {
// Reset occupant information.
userHasLeft();
for (UserStatusListener listener : userStatusListeners) { for (UserStatusListener listener : userStatusListeners) {
listener.kicked(mucUser.getItem().getActor(), mucUser.getItem().getReason()); listener.kicked(mucUser.getItem().getActor(), mucUser.getItem().getReason());
} }
// Reset occupant information.
userHasLeft();
} }
else { else {
for (ParticipantStatusListener listener : participantStatusListeners) { for (ParticipantStatusListener listener : participantStatusListeners) {