Home | History | Annotate | Download | only in smackx

Lines Matching defs:chat

37  * Handles chat state for all chats on a particular Connection. This class manages both the
87 * Maps chat to last chat state.
89 private final Map<Chat, ChatState> chatStates =
90 new ReferenceMap<Chat, ChatState>(ReferenceMap.WEAK, ReferenceMap.HARD);
106 * Sets the current state of the provided chat. This method will send an empty bodied Message
108 * and only if the new chat state is different than the last state.
110 * @param newState the new state of the chat
111 * @param chat the chat.
116 public void setCurrentState(ChatState newState, Chat chat) throws XMPPException {
117 if(chat == null || newState == null) {
120 if(!updateChatState(chat, newState)) {
127 chat.sendMessage(message);
145 private boolean updateChatState(Chat chat, ChatState newState) {
146 ChatState lastChatState = chatStates.get(chat);
148 chatStates.put(chat, newState);
154 private void fireNewChatState(Chat chat, ChatState state) {
155 for (MessageListener listener : chat.getListeners()) {
157 ((ChatStateListener) listener).stateChanged(chat, state);
166 Chat chat = connection.getChatManager().getThreadChat(message.getThread());
167 if (chat == null) {
170 if (updateChatState(chat, ChatState.active)) {
178 public void chatCreated(final Chat chat, boolean createdLocally) {
179 chat.addMessageListener(this);
182 public void processMessage(Chat chat, Message message) {
197 fireNewChatState(chat, state);