/** * Checks to see if the Occupant is a moderator. * * @param occupant the Occupant of a room. * @return true if the user is a moderator. */ public boolean isModerator(Occupant occupant) { return occupant != null && occupant.getRole() == MUCRole.moderator; }
public boolean hasVoice(GroupChatRoom groupChatRoom, Resourcepart nickname) { Occupant occupant = getOccupant(groupChatRoom, nickname); if (occupant != null) { if ( MUCRole.visitor == occupant.getRole()) { return false; } } return true; }
@Override public ChatRoomMemberRole getRole() { if (this.role == null) { Occupant o = chatRoom.getOccupant(this); if (o == null) { return ChatRoomMemberRole.GUEST; } else { this.role = ChatRoomJabberImpl.smackRoleToScRole( o.getRole(), o.getAffiliation()); } } return this.role; }
@Override public ChatRoomMemberRole getUserRole() { if (this.role == null) { Occupant o = muc.getOccupant(myOccupantJid); if (o == null) { return null; } else { this.role = ChatRoomJabberImpl.smackRoleToScRole( o.getRole(), o.getAffiliation()); } } return this.role; }