public final class ChatStateManager
extends org.jivesoftware.smack.Manager
getInstance(org.jivesoftware.smack.XMPPConnection)
needs to be called in order for the listeners to be registered appropriately with the connection.
If this does not occur you will not receive the update notifications.ChatState
,
ChatStateExtension
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE |
Modifier and Type | Method and Description |
---|---|
boolean |
addChatStateListener(ChatStateListener listener)
Register a ChatStateListener.
|
boolean |
equals(java.lang.Object o) |
static ChatStateManager |
getInstance(org.jivesoftware.smack.XMPPConnection connection)
Returns the ChatStateManager related to the XMPPConnection and it will create one if it does
not yet exist.
|
int |
hashCode() |
boolean |
removeChatStateListener(ChatStateListener listener)
Unregister a ChatStateListener.
|
void |
setCurrentState(ChatState newState,
Chat chat)
Sets the current state of the provided chat.
|
public static final java.lang.String NAMESPACE
public static ChatStateManager getInstance(org.jivesoftware.smack.XMPPConnection connection)
connection
- the connection to return the ChatStateManagerpublic boolean addChatStateListener(ChatStateListener listener)
listener
- chatStateListenerpublic boolean removeChatStateListener(ChatStateListener listener)
listener
- chatStateListenerpublic void setCurrentState(ChatState newState, Chat chat) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
ExtensionElement
, if
and only if the new chat state is different than the last state.newState
- the new state of the chatchat
- the chat.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object