diff options
author | iNPUTmice <daniel@gultsch.de> | 2015-02-21 11:06:52 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2015-02-21 11:06:52 +0100 |
commit | 7ee5e959597cfded524c7179b663138aca781ad8 (patch) | |
tree | 29a97c63d690a4d419a5500b1bb5a1c10f1f078b /src/main/java/eu/siacs/conversations/entities/Conversation.java | |
parent | 3f248e0d89af977e7f602102663be9729430f1ed (diff) |
added typing notifications through XEP-0085. fixed #210
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Conversation.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 71c2523e1..1feb04c7f 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -21,6 +21,7 @@ import java.util.Comparator; import java.util.List; import eu.siacs.conversations.Config; +import eu.siacs.conversations.xmpp.chatstate.ChatState; import eu.siacs.conversations.xmpp.jid.InvalidJidException; import eu.siacs.conversations.xmpp.jid.Jid; @@ -77,6 +78,8 @@ public class Conversation extends AbstractEntity implements Blockable { private Bookmark bookmark; private boolean messagesLeftOnServer = true; + private ChatState mOutgoingChatState = Config.DEFAULT_CHATSTATE; + private ChatState mIncomingChatState = Config.DEFAULT_CHATSTATE; public boolean hasMessagesLeftOnServer() { return messagesLeftOnServer; @@ -138,6 +141,34 @@ public class Conversation extends AbstractEntity implements Blockable { } } + public boolean setIncomingChatState(ChatState state) { + if (this.mIncomingChatState == state) { + return false; + } + this.mIncomingChatState = state; + return true; + } + + public ChatState getIncomingChatState() { + return this.mIncomingChatState; + } + + public boolean setOutgoingChatState(ChatState state) { + if (mode == MODE_MULTI) { + return false; + } + if (this.mOutgoingChatState != state) { + this.mOutgoingChatState = state; + return true; + } else { + return false; + } + } + + public ChatState getOutgoingChatState() { + return this.mOutgoingChatState; + } + public void trim() { synchronized (this.messages) { final int size = messages.size(); |