mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-24 03:27:59 +01:00
Fix MUC participantStatusListeners
Thanks to Anno van Vliet for reporting the issue and proposing the fix.
This commit is contained in:
parent
0279677883
commit
85a9b07230
2 changed files with 14 additions and 1 deletions
|
@ -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(),
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue