diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-24 21:53:43 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-24 21:53:43 +0100 |
commit | e75acffa61b46a6320ca0341252b720b0609536b (patch) | |
tree | 7e65a6aa8d7dd4d0b2378ce8832156072510d045 /src | |
parent | 13fda37f57578846aff5fdd0ec3cb323fb234b29 (diff) |
changed design language to match BTBV proposal
* untrusted messages have red background
* unverified messages have normal background and red lock
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Message.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 17 | ||||
-rw-r--r-- | src/main/res/values/strings.xml | 1 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java index 4224f6d6f..14120908f 100644 --- a/src/main/java/de/pixart/messenger/entities/Message.java +++ b/src/main/java/de/pixart/messenger/entities/Message.java @@ -495,7 +495,7 @@ public class Message extends AbstractEntity { !message.bodyIsHeart() && !this.bodyIsXmpp() && !message.bodyIsXmpp() && - this.isTrusted() == message.isTrusted() + ((this.axolotlFingerprint == null && message.axolotlFingerprint == null) || this.axolotlFingerprint.equals(message.getFingerprint())) ); } @@ -819,7 +819,7 @@ public class Message extends AbstractEntity { public boolean isTrusted() { FingerprintStatus s = conversation.getAccount().getAxolotlService().getFingerprintTrust(axolotlFingerprint); - return s != null && s.isTrustedAndActive(); + return s != null && s.isTrusted(); } private int getPreviousEncryption() { diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 6cf16fdd5..6939ad1d7 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -141,7 +141,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } } - private void displayStatus(ViewHolder viewHolder, Message message, int type, boolean darkBackground) { + private void displayStatus(ViewHolder viewHolder, Message message, int type, boolean darkBackground, boolean inValidSession) { String filesize = null; String info = null; boolean error = false; @@ -224,8 +224,8 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie .getAccount().getAxolotlService().getFingerprintTrust( message.getFingerprint()); - if (status == null || (!status.isTrustedAndActive())) { - viewHolder.indicator.setColorFilter(activity.getWarningTextColor()); + if(status == null || (!status.isVerified() && inValidSession)) { + viewHolder.indicator.setColorFilter(0xffc64545); viewHolder.indicator.setAlpha(1.0f); } else { viewHolder.indicator.clearColorFilter(); @@ -582,7 +582,8 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie @Override public View getView(int position, View unused, ViewGroup parent) { final Message message = getItem(position); - final boolean isInValidSession = message.isValidInSession(); + final boolean omemoEncryption = message.getEncryption() == Message.ENCRYPTION_AXOLOTL; + final boolean isInValidSession = message.isValidInSession() && (!omemoEncryption || message.isTrusted()); final Conversation conversation = message.getConversation(); final Account account = conversation.getAccount(); final int type = getItemViewType(position); @@ -793,7 +794,11 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } else { viewHolder.message_box.setBackgroundResource(R.drawable.message_bubble_received_warning); viewHolder.encryption.setVisibility(View.VISIBLE); - viewHolder.encryption.setText(CryptoHelper.encryptionTypeToText(message.getEncryption())); + if (omemoEncryption && !message.isTrusted()) { + viewHolder.encryption.setText(R.string.not_trusted); + } else { + viewHolder.encryption.setText(CryptoHelper.encryptionTypeToText(message.getEncryption())); + } } } @@ -805,7 +810,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie } } - displayStatus(viewHolder, message, type, darkBackground); + displayStatus(viewHolder, message, type, darkBackground, isInValidSession); return view; } diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index efd8bcc26..316d35d64 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -721,4 +721,5 @@ <string name="blindly_trusted_omemo_keys">Blindly trusted OMEMO keys</string> <string name="pref_blind_trust_before_verification">Blind Trust Before Verification</string> <string name="pref_blind_trust_before_verification_summary">Automatically trust all new devices from contacts that haven’t been verified before.</string> + <string name="not_trusted">Untrusted</string> </resources> |