improvements for merge conditions
This commit is contained in:
parent
28fa48704d
commit
bda7724e31
|
@ -15,6 +15,8 @@ public final class Config {
|
||||||
public static final int AVATAR_SIZE = 192;
|
public static final int AVATAR_SIZE = 192;
|
||||||
public static final Bitmap.CompressFormat AVATAR_FORMAT = Bitmap.CompressFormat.WEBP;
|
public static final Bitmap.CompressFormat AVATAR_FORMAT = Bitmap.CompressFormat.WEBP;
|
||||||
|
|
||||||
|
public static final int MESSAGE_MERGE_WINDOW = 20;
|
||||||
|
|
||||||
private Config() {
|
private Config() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.siacs.conversations.entities;
|
package eu.siacs.conversations.entities;
|
||||||
|
|
||||||
|
import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
import eu.siacs.conversations.xmpp.jingle.JingleConnection;
|
import eu.siacs.conversations.xmpp.jingle.JingleConnection;
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
|
@ -320,9 +321,12 @@ public class Message extends AbstractEntity {
|
||||||
&& this.getType() == message.getType()
|
&& this.getType() == message.getType()
|
||||||
&& this.getEncryption() == message.getEncryption()
|
&& this.getEncryption() == message.getEncryption()
|
||||||
&& this.getCounterpart().equals(message.getCounterpart())
|
&& this.getCounterpart().equals(message.getCounterpart())
|
||||||
&& (message.getTimeSent() - this.getTimeSent()) <= 20000 && ((this
|
&& (message.getTimeSent() - this.getTimeSent()) <= (Config.MESSAGE_MERGE_WINDOW * 1000) && ((this
|
||||||
.getStatus() == message.getStatus()) || (this.getStatus() == Message.STATUS_SEND && message
|
.getStatus() == message.getStatus()) || ((this.getStatus() == Message.STATUS_SEND || this
|
||||||
.getStatus() == Message.STATUS_UNSEND)));
|
.getStatus() == Message.STATUS_SEND_RECEIVED) && (message
|
||||||
|
.getStatus() == Message.STATUS_UNSEND
|
||||||
|
|| message.getStatus() == Message.STATUS_SEND || message
|
||||||
|
.getStatus() == Message.STATUS_SEND_DISPLAYED))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMergedBody() {
|
public String getMergedBody() {
|
||||||
|
|
Loading…
Reference in New Issue