|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smack.ChatManager
public class ChatManager
The chat manager keeps track of references to all current chats. It will not hold any references
in memory on its own so it is necessary to keep a reference to the chat object itself. To be
made aware of new chats, register a listener by calling addChatListener(ChatManagerListener)
.
Nested Class Summary | |
---|---|
static class |
ChatManager.MatchMode
Defines the different modes under which a match will be attempted with an existing chat when the incoming message does not have a thread id. |
Method Summary | |
---|---|
void |
addChatListener(ChatManagerListener listener)
Register a new listener with the ChatManager to recieve events related to chats. |
void |
addOutgoingMessageInterceptor(PacketInterceptor packetInterceptor)
Adds an interceptor which intercepts any messages sent through chats. |
void |
addOutgoingMessageInterceptor(PacketInterceptor packetInterceptor,
PacketFilter filter)
|
Chat |
createChat(java.lang.String userJID,
MessageListener listener)
Creates a new chat and returns it. |
Chat |
createChat(java.lang.String userJID,
java.lang.String thread,
MessageListener listener)
Creates a new chat using the specified thread ID, then returns it. |
java.util.Collection<ChatManagerListener> |
getChatListeners()
Returns an unmodifiable collection of all chat listeners currently registered with this manager. |
ChatManager.MatchMode |
getMatchMode()
Gets the current mode for matching messages with NO thread id to existing chats. |
Chat |
getThreadChat(java.lang.String thread)
|
boolean |
isNormalIncluded()
Determines whether incoming messages of type normal will be used for creating new chats or matching a message to existing ones. |
void |
removeChatListener(ChatManagerListener listener)
Removes a listener, it will no longer be notified of new events related to chats. |
static void |
setDefaultIsNormalIncluded(boolean allowNormal)
|
static void |
setDefaultMatchMode(ChatManager.MatchMode mode)
|
void |
setMatchMode(ChatManager.MatchMode matchMode)
Sets the mode for matching messages with NO thread id to existing chats. |
void |
setNormalIncluded(boolean normalIncluded)
Sets whether to allow incoming messages of type normal to be used for creating new chats or matching a message to an existing one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean isNormalIncluded()
public void setNormalIncluded(boolean normalIncluded)
normalIncluded
- true to allow normal, false otherwise.public ChatManager.MatchMode getMatchMode()
public void setMatchMode(ChatManager.MatchMode matchMode)
matchMode
- The mode to set.public Chat createChat(java.lang.String userJID, MessageListener listener)
userJID
- the user this chat is with.listener
- the listener which will listen for new messages from this chat.
public Chat createChat(java.lang.String userJID, java.lang.String thread, MessageListener listener)
userJID
- the jid of the user this chat is withthread
- the thread of the created chat.listener
- the listener to add to the chat
public Chat getThreadChat(java.lang.String thread)
public void addChatListener(ChatManagerListener listener)
listener
- the listener.public void removeChatListener(ChatManagerListener listener)
listener
- the listener that is being removedpublic java.util.Collection<ChatManagerListener> getChatListeners()
public void addOutgoingMessageInterceptor(PacketInterceptor packetInterceptor)
packetInterceptor
- the interceptor.public void addOutgoingMessageInterceptor(PacketInterceptor packetInterceptor, PacketFilter filter)
public static void setDefaultMatchMode(ChatManager.MatchMode mode)
public static void setDefaultIsNormalIncluded(boolean allowNormal)
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |