1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

[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

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) {