Package org.jivesoftware.smack.chat2
Class ChatManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smack.chat2.ChatManager
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 TypeMethodDescriptionboolean
Add a new listener for incoming chat messages.boolean
Add a new listener for outgoing chat messages.chatWith
(EntityBareJid jid) Start a new or retrieve the existing chat withjid
.static ChatManager
getInstanceFor
(XMPPConnection connection) boolean
Remove an incoming chat message listener.boolean
Remove an outgoing chat message listener.void
setXhmtlImEnabled
(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:
true
if the listener was not already added.
-
removeIncomingListener
Remove an incoming chat message listener.- Parameters:
listener
- the listener to remove.- Returns:
true
if the listener was active and got removed.
-
addOutgoingListener
Add a new listener for outgoing chat messages.- Parameters:
listener
- the listener to add.- Returns:
true
if the listener was not already added.
-
removeOutgoingListener
Remove an outgoing chat message listener.- Parameters:
listener
- the listener to remove.- Returns:
true
if 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
Also notify about messages containing XHTML-IM.- Parameters:
xhtmlIm
- TODO javadoc me please
-