aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorChristian S. <kriztan@users.noreply.github.com>2015-07-18 10:45:24 +0200
committerChristian S. <kriztan@users.noreply.github.com>2015-07-18 10:45:24 +0200
commit733d12d4964ea4e3c5267d4d7805cd385f9fd41d (patch)
tree8d8b99eec2bb8e2fe5f6e4e567dea4f6a798fd9e /src/main/java/eu/siacs
parent71c40c81b0fb02c31bc13b8b4ec35ecff30747f3 (diff)
parent67005385951cd6d0c172c9056b2a99ba46c10c93 (diff)
Merge pull request #10 from kriztan/siacs-development
version 1.5.0
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Message.java26
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java4
3 files changed, 21 insertions, 11 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index 28ef89df1..957c2a6d7 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -321,15 +321,25 @@ public class Message extends AbstractEntity {
return this.serverMsgId.equals(message.getServerMsgId());
} else if (this.body == null || this.counterpart == null) {
return false;
- } else if (message.getRemoteMsgId() != null) {
- return (message.getRemoteMsgId().equals(this.remoteMsgId) || message.getRemoteMsgId().equals(this.uuid))
- && this.counterpart.equals(message.getCounterpart())
- && this.body.equals(message.getBody());
} else {
- return this.remoteMsgId == null
- && this.counterpart.equals(message.getCounterpart())
- && this.body.equals(message.getBody())
- && Math.abs(this.getTimeSent() - message.getTimeSent()) < Config.MESSAGE_MERGE_WINDOW * 1000;
+ 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))
+ && this.counterpart.equals(message.getCounterpart())
+ && body.equals(otherBody);
+ } else {
+ return this.remoteMsgId == null
+ && this.counterpart.equals(message.getCounterpart())
+ && body.equals(otherBody)
+ && Math.abs(this.getTimeSent() - message.getTimeSent()) < Config.MESSAGE_MERGE_WINDOW * 1000;
+ }
}
}
diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
index 6fcd8c870..62fe4191d 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
@@ -90,7 +90,7 @@ public class HttpDownloadConnection implements Transferable {
&& this.file.getKey() == null) {
this.message.setEncryption(Message.ENCRYPTION_NONE);
}
- checkFileSize(true);
+ checkFileSize(interactive);
} catch (MalformedURLException e) {
this.cancel();
}
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
index f78bfc5d1..c0ee779a6 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
@@ -52,7 +52,7 @@ public class AccountAdapter extends ArrayAdapter<Account> {
break;
}
final Switch tglAccountState = (Switch) view.findViewById(R.id.tgl_account_status);
- final boolean isDisabled = (account.getStatus() == Account.State.DISABLED) ? true : false;
+ final boolean isDisabled = (account.getStatus() == Account.State.DISABLED);
tglAccountState.setOnCheckedChangeListener(null);
tglAccountState.setChecked(!isDisabled);
tglAccountState.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@@ -65,4 +65,4 @@ public class AccountAdapter extends ArrayAdapter<Account> {
});
return view;
}
-} \ No newline at end of file
+}