Package org.jivesoftware.smack.chat2
Class ChatManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smack.chat2.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 withjid
.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.-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Method Detail
-
getInstanceFor
public static ChatManager getInstanceFor(XMPPConnection connection)
-
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 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
-
-