From d1273532ce01625bf7f73885144b55ad830546fb Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 13 Dec 2021 21:15:30 +0100 Subject: [PATCH] [muc] Correctly processes self-presences The change in 52a49769f9a8 ("[muc] Check for self-presence first in presence listener") caused all self-presences (MUC user status 110) to be ignored in the further processing chain eventually invoking checkRoleModifications() and checkAffiliationModifications(). However, some servers (e.g., ejabberd) include 110 not only in the initial presence but in all following, and we ant to process these. Fixes SMACK-918 Fixes: 52a49769f9a825a8c0252efcad0d96635fb257a6 --- .../java/org/jivesoftware/smackx/muc/MultiUserChat.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index 78d725508..92e8ec3f3 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -211,13 +211,15 @@ public class MultiUserChat { switch (presence.getType()) { case available: - Presence oldPresence = occupantsMap.put(from, presence); if (mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110)) { processedReflectedSelfPresence = true; synchronized (this) { notify(); } - } else if (oldPresence != null) { + } + + Presence oldPresence = occupantsMap.put(from, presence); + if (oldPresence != null) { // Get the previous occupant's affiliation & role MUCUser mucExtension = MUCUser.from(oldPresence); MUCAffiliation oldAffiliation = mucExtension.getItem().getAffiliation();