/** Updates invite contact button depending on the user role we have. */ private void updateInviteContactButton() { if (chatSession instanceof ConferenceChatSession) { ChatRoomMemberRole role = ((ChatRoomWrapper) chatSession.getDescriptor()).getChatRoom().getUserRole(); // it means we are at least a moderator inviteButton.setEnabled(role.getRoleIndex() >= 50); } }