/**
   * Removes the user interface related to the given protocol provider.
   *
   * @param protocolProvider the protocol provider to remove
   */
  public void removeProtocolProviderUI(ProtocolProviderService protocolProvider) {
    OperationSetBasicTelephony<?> telOpSet =
        protocolProvider.getOperationSet(OperationSetBasicTelephony.class);

    if (telOpSet != null) {
      telOpSet.removeCallListener(androidCallListener);
    }

    OperationSetPresence presenceOpSet =
        protocolProvider.getOperationSet(OperationSetPresence.class);

    if (presenceOpSet != null) {
      presenceOpSet.removeProviderPresenceStatusListener(androidPresenceListener);
    }

    // Removes all chat session for unregistered provider
    ChatSessionManager.removeAllChatsForProvider(protocolProvider);
  }
 /**
  * Removes the registration of a <tt>NewChatListener</tt>.
  *
  * @param listener listener to be unregistered
  */
 public void removeChatListener(ChatListener listener) {
   ChatSessionManager.removeChatListener(listener);
 }
 /**
  * Registers a <tt>NewChatListener</tt> to be informed when new <tt>Chats</tt> are created.
  *
  * @param listener listener to be registered
  */
 public void addChatListener(ChatListener listener) {
   ChatSessionManager.addChatListener(listener);
 }
 /**
  * Provides all currently instantiated <tt>Chats</tt>.
  *
  * @return all active <tt>Chats</tt>.
  */
 public Collection<Chat> getAllChats() {
   return ChatSessionManager.getActiveChats();
 }
 /**
  * Returns the selected <tt>Chat</tt>.
  *
  * @return the selected <tt>Chat</tt>.
  */
 public Chat getCurrentChat() {
   return ChatSessionManager.getCurrentChatSession();
 }
 /**
  * Returns a list of all open Chats
  *
  * @return A list of all open Chats
  */
 public List<Chat> getChats() {
   return ChatSessionManager.getActiveChats();
 }
 /**
  * Returns the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>.
  *
  * @param contact the <tt>Contact</tt> for which the searched chat is about.
  * @return the <tt>Chat</tt> corresponding to the given <tt>Contact</tt>.
  */
 public Chat getChat(Contact contact) {
   return ChatSessionManager.findChatForContact(contact, true);
 }