mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-30 20:52:21 -05:00
changed message merger a bit
This commit is contained in:
parent
49adf4f69a
commit
98a8fd4d05
@ -246,9 +246,10 @@ public class Message extends AbstractEntity {
|
|||||||
|
|
||||||
public void setPresence(String presence) {
|
public void setPresence(String presence) {
|
||||||
if (presence == null) {
|
if (presence == null) {
|
||||||
this.counterpart = this.counterpart.split("/",2)[0];
|
this.counterpart = this.counterpart.split("/", 2)[0];
|
||||||
} else {
|
} else {
|
||||||
this.counterpart = this.counterpart.split("/",2)[0] + "/" + presence;
|
this.counterpart = this.counterpart.split("/", 2)[0] + "/"
|
||||||
|
+ presence;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,7 +258,7 @@ public class Message extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getPresence() {
|
public String getPresence() {
|
||||||
String[] counterparts = this.counterpart.split("/",2);
|
String[] counterparts = this.counterpart.split("/", 2);
|
||||||
if (counterparts.length == 2) {
|
if (counterparts.length == 2) {
|
||||||
return counterparts[1];
|
return counterparts[1];
|
||||||
} else {
|
} else {
|
||||||
@ -326,12 +327,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()) <= (Config.MESSAGE_MERGE_WINDOW * 1000)
|
&& (message.getTimeSent() - this.getTimeSent()) <= (Config.MESSAGE_MERGE_WINDOW * 1000) && ((this
|
||||||
&& ((this.getStatus() == message.getStatus())
|
.getStatus() == message.getStatus() || ((this.getStatus() == Message.STATUS_SEND || this
|
||||||
|| (this.getStatus() == Message.STATUS_SEND && (message.getStatus() == Message.STATUS_UNSEND
|
.getStatus() == Message.STATUS_SEND_RECEIVED) && (message
|
||||||
|| message.getStatus() == Message.STATUS_SEND))
|
.getStatus() == Message.STATUS_UNSEND
|
||||||
|| (this.getStatus() == Message.STATUS_SEND_RECEIVED
|
|| message.getStatus() == Message.STATUS_SEND || message
|
||||||
&& message.getStatus() == Message.STATUS_SEND_DISPLAYED)));
|
.getStatus() == Message.STATUS_SEND_DISPLAYED)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMergedBody() {
|
public String getMergedBody() {
|
||||||
|
Loading…
Reference in New Issue
Block a user