aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-08-23 19:40:45 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-08-23 19:40:45 +0200
commit8043833156119eef4662c50f30ca647bfc6d4438 (patch)
tree19becaa24196f247dee80414114c1a2e80b7c120 /src/main
parentb1f1a991906cd28ffb0c6e5a199872a1f508939a (diff)
bugfix: next encryption is now being properly detected
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java4
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index 9f9f34cf8..36d6b43b0 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -552,7 +552,7 @@ public class Conversation extends AbstractEntity implements Blockable {
private int getMostRecentlyUsedOutgoingEncryption() {
synchronized (this.messages) {
for(int i = this.messages.size() -1; i >= 0; --i) {
- final Message m = this.messages.get(0);
+ final Message m = this.messages.get(i);
if (!m.isCarbon() && m.getStatus() != Message.STATUS_RECEIVED) {
final int e = m.getEncryption();
if (e == Message.ENCRYPTION_DECRYPTED || e == Message.ENCRYPTION_DECRYPTION_FAILED) {
@@ -569,7 +569,7 @@ public class Conversation extends AbstractEntity implements Blockable {
private int getMostRecentlyUsedIncomingEncryption() {
synchronized (this.messages) {
for(int i = this.messages.size() -1; i >= 0; --i) {
- final Message m = this.messages.get(0);
+ final Message m = this.messages.get(i);
if (m.getStatus() == Message.STATUS_RECEIVED) {
final int e = m.getEncryption();
if (e == Message.ENCRYPTION_DECRYPTED || e == Message.ENCRYPTION_DECRYPTION_FAILED) {
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
index 00637257c..9381ba1d8 100644
--- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
@@ -133,7 +133,6 @@ public class FileBackend {
if (path == null) {
return false;
}
- Log.d(Config.LOGTAG,"using image as is. path: "+path);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
try {