public final class ChatStateManager extends ExtensionManager
Because the Chat State protocol is relatively simple, the primary purpose of this manager is to enable or disable the Chat State protocol for Service Discovery purposes.
Furthermore it ensures that every sent message has a chat state notification as required by XEP-0085.
ChatStateManager chatStateManager = xmppSession.getManager(ChatStateManager.class);
chatStateManager.setChatState(ChatState.COMPOSING, chat);
ChatState chatState = message.getExtension(ChatState.class);
if (chatState == ChatState.COMPOSING) {
// Contact is typing.
} else if (chatState == ChatState.PAUSED) {
// Contact has paused typing.
}
| Modifier and Type | Method and Description |
|---|---|
boolean |
setChatState(ChatState chatState,
Chat chat)
Sets the chat state for a chat.
|
isEnabled, setEnabledpublic final boolean setChatState(ChatState chatState, Chat chat)
chatState - The chat state.chat - The chat.Copyright © 2014–2015 XMPP.rocks. All rights reserved.