account for downloaded http files in dup checker

This commit is contained in:
Daniel Gultsch 2015-07-18 00:01:34 +02:00
parent aa1b9de20c
commit ce527c8b76
1 changed files with 18 additions and 8 deletions

View File

@ -321,17 +321,27 @@ public class Message extends AbstractEntity {
return this.serverMsgId.equals(message.getServerMsgId()); return this.serverMsgId.equals(message.getServerMsgId());
} else if (this.body == null || this.counterpart == null) { } else if (this.body == null || this.counterpart == null) {
return false; return false;
} else if (message.getRemoteMsgId() != null) { } else {
String body, otherBody;
if (this.hasFileOnRemoteHost()) {
body = getFileParams().url.toString();
otherBody = message.body == null ? null : message.body.trim();
} else {
body = this.body;
otherBody = message.body;
}
if (message.getRemoteMsgId() != null) {
return (message.getRemoteMsgId().equals(this.remoteMsgId) || message.getRemoteMsgId().equals(this.uuid)) return (message.getRemoteMsgId().equals(this.remoteMsgId) || message.getRemoteMsgId().equals(this.uuid))
&& this.counterpart.equals(message.getCounterpart()) && this.counterpart.equals(message.getCounterpart())
&& this.body.equals(message.getBody()); && body.equals(otherBody);
} else { } else {
return this.remoteMsgId == null return this.remoteMsgId == null
&& this.counterpart.equals(message.getCounterpart()) && this.counterpart.equals(message.getCounterpart())
&& this.body.equals(message.getBody()) && body.equals(otherBody)
&& Math.abs(this.getTimeSent() - message.getTimeSent()) < Config.MESSAGE_MERGE_WINDOW * 1000; && Math.abs(this.getTimeSent() - message.getTimeSent()) < Config.MESSAGE_MERGE_WINDOW * 1000;
} }
} }
}
public Message next() { public Message next() {
synchronized (this.conversation.messages) { synchronized (this.conversation.messages) {