diff options
author | Andreas Straub <andy@strb.org> | 2015-07-30 19:16:58 +0200 |
---|---|---|
committer | Andreas Straub <andy@strb.org> | 2015-07-30 19:18:09 +0200 |
commit | 74ab36fda2d977e1b97b755a8298c488e6d74ba2 (patch) | |
tree | 8b25de1e9b204166f1ac8a0c7dc396b4247b7411 /src/main/java/eu/siacs/conversations/ui | |
parent | 1ed550b5c54ff873375c30fd94e4f20523f15187 (diff) |
Fix session logic: enforce same type of encryption
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 4d1260e83..76da42c4c 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -569,32 +569,10 @@ public class MessageAdapter extends ArrayAdapter<Message> { } if (type == RECEIVED) { - boolean wasEncrypted = false; - for (Message iterator = message.prev(); iterator != null; iterator = iterator.prev()){ - if (iterator.getEncryption() != Message.ENCRYPTION_NONE) { - wasEncrypted = true; - break; - } - if (!iterator.isCarbon() && iterator.getType() == SENT) { - break; - } - } - boolean willBeEncrypted = conversation.getNextEncryption(false) != Message.ENCRYPTION_NONE; - for (Message iterator = message.next(); iterator != null; iterator = iterator.next()){ - if (iterator.getEncryption() != Message.ENCRYPTION_NONE) { - willBeEncrypted = true; - break; - } - if (!iterator.isCarbon() && iterator.getType() == SENT) { - break; - } - } - - if ( willBeEncrypted && wasEncrypted - && message.getEncryption() == Message.ENCRYPTION_NONE) { - viewHolder.message_box.setBackgroundResource(R.drawable.message_bubble_received_warning); - } else { + if(message.isValidInSession()) { viewHolder.message_box.setBackgroundResource(R.drawable.message_bubble_received); + } else { + viewHolder.message_box.setBackgroundResource(R.drawable.message_bubble_received_warning); } } |