public final class ChatManager extends Manager
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.
Modifier and Type | Method and Description |
---|---|
boolean |
addIncomingListener(IncomingChatMessageListener listener)
Add a new listener for incoming chat messages.
|
boolean |
addOutgoingListener(OutgoingChatMessageListener listener)
Add a new listener for outgoing chat messages.
|
Chat |
chatWith(EntityBareJid jid)
Start a new or retrieve the existing chat with
jid . |
static ChatManager |
getInstanceFor(XMPPConnection connection) |
boolean |
removeIncomingListener(IncomingChatMessageListener listener)
Remove an incoming chat message listener.
|
boolean |
removeOutgoingListener(OutgoingChatMessageListener listener)
Remove an outgoing chat message listener.
|
void |
setXhmtlImEnabled(boolean xhtmlIm)
Also notify about messages containing XHTML-IM.
|
connection, getAuthenticatedConnectionOrThrow, schedule
public static ChatManager getInstanceFor(XMPPConnection connection)
public boolean addIncomingListener(IncomingChatMessageListener listener)
listener
- the listener to add.true
if the listener was not already added.public boolean removeIncomingListener(IncomingChatMessageListener listener)
listener
- the listener to remove.true
if the listener was active and got removed.public boolean addOutgoingListener(OutgoingChatMessageListener listener)
listener
- the listener to add.true
if the listener was not already added.public boolean removeOutgoingListener(OutgoingChatMessageListener listener)
listener
- the listener to remove.true
if the listener was active and got removed.public Chat chatWith(EntityBareJid jid)
jid
.jid
- the XMPP address of the other entity to chat with.public void setXhmtlImEnabled(boolean xhtmlIm)
xhtmlIm
-