diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-08-31 18:21:46 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-08-31 18:21:46 +0200 |
commit | bda7724e317dd46f831df29c4c920b3913c533cb (patch) | |
tree | e5c072207e2c6850a3becd1de8657365ec7eb4b5 /src | |
parent | 28fa48704d4084617d7e32e4a10f785c4b996163 (diff) |
improvements for merge conditions
Diffstat (limited to 'src')
-rw-r--r-- | src/eu/siacs/conversations/Config.java | 2 | ||||
-rw-r--r-- | src/eu/siacs/conversations/entities/Message.java | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/Config.java b/src/eu/siacs/conversations/Config.java index 4d90b919..04c8af3d 100644 --- a/src/eu/siacs/conversations/Config.java +++ b/src/eu/siacs/conversations/Config.java @@ -14,6 +14,8 @@ public final class Config { public static final int AVATAR_SIZE = 192; public static final Bitmap.CompressFormat AVATAR_FORMAT = Bitmap.CompressFormat.WEBP; + + public static final int MESSAGE_MERGE_WINDOW = 20; private Config() { diff --git a/src/eu/siacs/conversations/entities/Message.java b/src/eu/siacs/conversations/entities/Message.java index 9e977911..2dc1bfb5 100644 --- a/src/eu/siacs/conversations/entities/Message.java +++ b/src/eu/siacs/conversations/entities/Message.java @@ -1,5 +1,6 @@ package eu.siacs.conversations.entities; +import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.xmpp.jingle.JingleConnection; import android.content.ContentValues; @@ -320,9 +321,12 @@ public class Message extends AbstractEntity { && this.getType() == message.getType() && this.getEncryption() == message.getEncryption() && this.getCounterpart().equals(message.getCounterpart()) - && (message.getTimeSent() - this.getTimeSent()) <= 20000 && ((this - .getStatus() == message.getStatus()) || (this.getStatus() == Message.STATUS_SEND && message - .getStatus() == Message.STATUS_UNSEND))); + && (message.getTimeSent() - this.getTimeSent()) <= (Config.MESSAGE_MERGE_WINDOW * 1000) && ((this + .getStatus() == message.getStatus()) || ((this.getStatus() == Message.STATUS_SEND || this + .getStatus() == Message.STATUS_SEND_RECEIVED) && (message + .getStatus() == Message.STATUS_UNSEND + || message.getStatus() == Message.STATUS_SEND || message + .getStatus() == Message.STATUS_SEND_DISPLAYED)))); } public String getMergedBody() { |