Class ChatManager


  • public final class ChatManager
    extends Manager
    A chat manager for 1:1 XMPP instant messaging chats.

    This manager and the according Chat API implement "Resource Locking" (XEP-0296). Support for Carbon Copies (XEP-0280) will be added once the XEP has progressed from experimental.

    See Also:
    XEP-0296: Best Practices for Resource Locking
    • Method Detail

      • addIncomingListener

        public boolean addIncomingListener​(IncomingChatMessageListener listener)
        Add a new listener for incoming chat messages.
        Parameters:
        listener - the listener to add.
        Returns:
        true if the listener was not already added.
      • removeIncomingListener

        public boolean removeIncomingListener​(IncomingChatMessageListener listener)
        Remove an incoming chat message listener.
        Parameters:
        listener - the listener to remove.
        Returns:
        true if the listener was active and got removed.
      • addOutgoingListener

        public boolean addOutgoingListener​(OutgoingChatMessageListener listener)
        Add a new listener for outgoing chat messages.
        Parameters:
        listener - the listener to add.
        Returns:
        true if the listener was not already added.
      • removeOutgoingListener

        public boolean removeOutgoingListener​(OutgoingChatMessageListener listener)
        Remove an outgoing chat message listener.
        Parameters:
        listener - the listener to remove.
        Returns:
        true if the listener was active and got removed.
      • chatWith

        public Chat chatWith​(EntityBareJid jid)
        Start a new or retrieve the existing chat with jid.
        Parameters:
        jid - the XMPP address of the other entity to chat with.
        Returns:
        the Chat API for the given XMPP address.
      • setXhmtlImEnabled

        public void setXhmtlImEnabled​(boolean xhtmlIm)
        Also notify about messages containing XHTML-IM.
        Parameters:
        xhtmlIm - TODO javadoc me please