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 |
addListener(IncomingChatMessageListener listener)
Deprecated.
|
boolean |
addListener(OutgoingChatMessageListener listener)
Deprecated.
use
addOutgoingListener(OutgoingChatMessageListener) instead. |
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 |
removeListener(IncomingChatMessageListener listener)
Remove an incoming chat message listener.
|
boolean |
removeListener(OutgoingChatMessageListener listener)
Remove an outgoing chat message listener.
|
boolean |
removeOutoingLIstener(OutgoingChatMessageListener listener)
Deprecated.
use
removeListener(OutgoingChatMessageListener) instead. |
void |
setXhmtlImEnabled(boolean xhtmlIm)
Also notify about messages containing XHTML-IM.
|
connection, getAuthenticatedConnectionOrThrow
public static ChatManager getInstanceFor(XMPPConnection connection)
public boolean addIncomingListener(IncomingChatMessageListener listener)
listener
- the listener to add.true
if the listener was not already added.@Deprecated public boolean addListener(IncomingChatMessageListener listener)
listener
- the listener to add.true
if the listener was not already added.public boolean removeListener(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.@Deprecated public boolean addListener(OutgoingChatMessageListener listener)
addOutgoingListener(OutgoingChatMessageListener)
instead.listener
- the listener to add.true
if the listener was not already added.public boolean removeListener(OutgoingChatMessageListener listener)
listener
- the listener to remove.true
if the listener was active and got removed.@Deprecated public boolean removeOutoingLIstener(OutgoingChatMessageListener listener)
removeListener(OutgoingChatMessageListener)
instead.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
-