[muc] Check for self-presence first in presence listener

Fixes SMACK-914
This commit is contained in:
Florian Schmaus 2021-10-05 20:42:42 +02:00
parent ec456399b5
commit 52a49769f9
1 changed files with 6 additions and 6 deletions

View File

@ -212,7 +212,12 @@ public class MultiUserChat {
switch (presence.getType()) {
case available:
Presence oldPresence = occupantsMap.put(from, presence);
if (oldPresence != null) {
if (mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110)) {
processedReflectedSelfPresence = true;
synchronized (this) {
notify();
}
} else if (oldPresence != null) {
// Get the previous occupant's affiliation & role
MUCUser mucExtension = MUCUser.from(oldPresence);
MUCAffiliation oldAffiliation = mucExtension.getItem().getAffiliation();
@ -228,11 +233,6 @@ public class MultiUserChat {
newAffiliation,
isUserStatusModification,
from);
} else if (mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110)) {
processedReflectedSelfPresence = true;
synchronized (this) {
notify();
}
} else {
// A new occupant has joined the room
for (ParticipantStatusListener listener : participantStatusListeners) {