Package org.jivesoftware.smack.chat2
Class ChatManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smack.chat2.ChatManager
public final class ChatManager
extends org.jivesoftware.smack.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.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd a new listener for incoming chat messages.booleanAdd a new listener for outgoing chat messages.chatWith(org.jxmpp.jid.EntityBareJid jid) Start a new or retrieve the existing chat withjid.static ChatManagergetInstanceFor(org.jivesoftware.smack.XMPPConnection connection) booleanRemove an incoming chat message listener.booleanRemove an outgoing chat message listener.voidsetXhmtlImEnabled(boolean xhtmlIm) Also notify about messages containing XHTML-IM.Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getInstanceFor
-
addIncomingListener
Add a new listener for incoming chat messages.- Parameters:
listener- the listener to add.- Returns:
trueif the listener was not already added.
-
removeIncomingListener
Remove an incoming chat message listener.- Parameters:
listener- the listener to remove.- Returns:
trueif the listener was active and got removed.
-
addOutgoingListener
Add a new listener for outgoing chat messages.- Parameters:
listener- the listener to add.- Returns:
trueif the listener was not already added.
-
removeOutgoingListener
Remove an outgoing chat message listener.- Parameters:
listener- the listener to remove.- Returns:
trueif the listener was active and got removed.
-
chatWith
Start a new or retrieve the existing chat withjid.- 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
-