// FIXME Do we have to do the following when we leave the room?
private void leave(String reason, EntityBareJid alternateAddress)
    {
        OperationSetBasicTelephonyJabberImpl basicTelephony
            = (OperationSetBasicTelephonyJabberImpl) provider
                .getOperationSet(OperationSetBasicTelephony.class);
        if(basicTelephony != null && this.publishedConference != null)
        {
            ActiveCallsRepositoryJabberImpl activeRepository
                    = basicTelephony.getActiveCallsRepository();
            String callid = publishedConference.getCallId();
            if (callid != null)
            {
                CallJabberImpl call = activeRepository.findCallId(callid);
                for(CallPeerJabberImpl peer : call.getCallPeerList())
                {
                    try
                    {
                        peer.hangup(false, null, null);
                    }
                    catch (NotConnectedException | InterruptedException e)
                    {
                        logger.error("Could not hangup peer " + peer.getAddress(), e);
                    }
                }
            }
        }
        List<CallJabberImpl> tmpConferenceCalls;
        synchronized (chatRoomConferenceCalls)
        {
            tmpConferenceCalls
                = new ArrayList<CallJabberImpl>(chatRoomConferenceCalls);
            chatRoomConferenceCalls.clear();
        }
        for(CallJabberImpl call : tmpConferenceCalls)
        {
            for(CallPeerJabberImpl peer : call.getCallPeerList())
            {
                try
                {
                    peer.hangup(false, null, null);
                }
                catch (NotConnectedException | InterruptedException e)
                {
                    logger.error("Could not hangup peer " + peer.getAddress(), e);
                }
            }
        }
        clearCachedConferenceDescriptionList();
        XMPPConnection connection = this.provider.getConnection();
        try
        {
            // if we are already disconnected
            // leave maybe called from gui when closing chat window
            if(connection != null)
                multiUserChat.leave();
        }
        catch(Throwable e)
        {
            logger.warn("Error occured while leaving, maybe just " +
                "disconnected before leaving", e);
        }
        // FIXME Do we have to do the following when we leave the room?
        Hashtable<Resourcepart, ChatRoomMemberJabberImpl> membersCopy;
        synchronized (members)
        {
            membersCopy = new Hashtable<>(members);
            // Delete the list of members
            members.clear();
        }
        for (ChatRoomMember member : membersCopy.values())
            fireMemberPresenceEvent(
                member,
                ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT,
                "Local user has left the chat room.");
        // connection can be null if we are leaving cause connection failed
        if(connection != null)
        {
            connection.removeAsyncStanzaListener(invitationRejectionListeners);
            if(presenceListener != null)
            {
                connection.removeAsyncStanzaListener(presenceListener);
                presenceListener = null;
            }
        }
        opSetMuc.fireLocalUserPresenceEvent(
            this,
            LocalUserChatRoomPresenceChangeEvent.LOCAL_USER_LEFT,
            reason,
            alternateAddress != null ? alternateAddress.toString() : null);
    }
"disconnected before leaving", e);
}
// FIXME Do we have to do the following when we leave the room?
Hashtable<Resourcepart, ChatRoomMemberJabberImpl> membersCopy;
synchronized (members)
// if we are already disconnected
// leave maybe called from gui when closing chat window
if(connection != null)
multiUserChat.leave();
}
catch(Throwable e)
{
logger.warn("Error occured while leaving, maybe just " +
"disconnected before leaving", e);
}
// FIXME Do we have to do the following when we leave the room?
Hashtable<Resourcepart, ChatRoomMemberJabberImpl> membersCopy;
synchronized (members)
{
membersCopy = new Hashtable<>(members);
// Delete the list of members
members.clear();
}
for (ChatRoomMember member : membersCopy.values())
fireMemberPresenceEvent(
member,
catch (NotConnectedException | InterruptedException e)
{
logger.error("Could not hangup peer " + peer.getAddress(), e);
}
}
}
clearCachedConferenceDescriptionList();
XMPPConnection connection = this.provider.getConnection();
try
{
// if we are already disconnected
// leave maybe called from gui when closing chat window
if(connection != null)
multiUserChat.leave();
}
catch(Throwable e)
{
logger.warn("Error occured while leaving, maybe just " +
"disconnected before leaving", e);
}
// FIXME Do we have to do the following when we leave the room?
Hashtable<Resourcepart, ChatRoomMemberJabberImpl> membersCopy;
synchronized (members)
{
membersCopy = new Hashtable<>(members);
// Delete the list of members
members.clear();
}
for (ChatRoomMember member : membersCopy.values())
fireMemberPresenceEvent(
member,
ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT,
"Local user has left the chat room.");
// connection can be null if we are leaving cause connection failed
if(connection != null)
{
connection.removeAsyncStanzaListener(invitationRejectionListeners);
if(presenceListener != null)
{
connection.removeAsyncStanzaListener(presenceListener);
presenceListener = null;