Fix MUC participantStatusListeners

Thanks to Anno van Vliet for reporting the issue and proposing the fix.
This commit is contained in:
Florian Schmaus 2015-03-03 17:05:42 +01:00
parent 0279677883
commit 85a9b07230
2 changed files with 14 additions and 1 deletions

View File

@ -197,7 +197,7 @@ public class MultiUserChat {
case unavailable:
occupantsMap.remove(from);
MUCUser mucUser = MUCUser.from(packet);
if (mucUser != null && mucUser.getStatus() != null) {
if (mucUser != null && mucUser.hasStatus()) {
// Fire events according to the received presence code
checkPresenceCode(
mucUser.getStatus(),

View File

@ -118,6 +118,19 @@ public class MUCUser implements ExtensionElement {
return statusCodes;
}
/**
* Returns true if this MUCUser instance has also {@link Status} information.
* <p>
* If <code>true</code> is returned, then {@link #getStatus()} will return a non-empty set.
* </p>
*
* @return true if this MUCUser has status information.
* @since 4.1
*/
public boolean hasStatus() {
return !statusCodes.isEmpty();
}
/**
* Returns the notification that the room has been destroyed. After a room has been destroyed,
* the room occupants will receive a Presence packet of type 'unavailable' with the reason for