Merge branch 'trz/rename' into trz/rebase

This commit is contained in:
lookshe 2016-03-20 17:37:44 +01:00
commit a8db6be4eb

View file

@ -360,29 +360,25 @@ public class Message extends AbstractEntity {
}
public boolean equals(Message message) {
if (this.serverMsgId != null && message.getServerMsgId() != null) {
return this.serverMsgId.equals(message.getServerMsgId());
} else if (this.getBody() == null || this.counterpart == null) {
if (this.getServerMsgId() != null && message.getServerMsgId() != null) {
return this.getServerMsgId().equals(message.getServerMsgId());
} else if (this.getBody() == null || this.getCounterpart() == null
|| message.getBody() == null || message.getCounterpart() == null) {
return false;
} else {
String body, otherBody;
if (this.hasFileOnRemoteHost()) {
body = getFileParams().url.toString();
otherBody = message.getBody() == null ? null : message.getBody();
} else {
body = this.getBody();
otherBody = message.getBody();
}
if (message.getRemoteMsgId() != null) {
return (message.getRemoteMsgId().equals(this.remoteMsgId) || message.getRemoteMsgId().equals(this.uuid))
&& this.counterpart.equals(message.getCounterpart())
&& (body.equals(otherBody)
if (message.getRemoteMsgId() != null && this.getRemoteMsgId() != null) {
return (message.getRemoteMsgId().equals(this.getRemoteMsgId())
|| message.getRemoteMsgId().equals(this.getUuid())
|| message.getUuid().equals(this.getRemoteMsgId()))
&& this.getCounterpart().equals(message.getCounterpart())
&& (this.getBody().equals(message.getBody())
||(message.getEncryption() == Message.ENCRYPTION_PGP
&& message.getRemoteMsgId().matches("[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}"))) ;
} else {
return this.remoteMsgId == null
&& this.counterpart.equals(message.getCounterpart())
&& body.equals(otherBody);
return this.getRemoteMsgId() == null
&& message.getRemoteMsgId() == null
&& this.getCounterpart().equals(message.getCounterpart())
&& this.getBody().equals(message.getBody());
}
}
}