aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-06-16 12:12:24 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-06-16 12:12:24 +0200
commit48a7818e883697913cc0a48960999d176ce8f5c0 (patch)
tree8c92b212da7197e124ac549abdd763f1f5b26386 /src/main/java/eu/siacs
parent1eb776f39ca02183c406e0931dcab04ad9539ac5 (diff)
mark used otr fingprint in contact details and highlight pgp
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java12
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java18
2 files changed, 26 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
index b67aae18..16051405 100644
--- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -419,8 +419,13 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
ImageButton removeButton = (ImageButton) view
.findViewById(R.id.button_remove);
removeButton.setVisibility(View.VISIBLE);
- keyType.setText("OTR Fingerprint");
key.setText(CryptoHelper.prettifyFingerprint(otrFingerprint));
+ if (otrFingerprint != null && otrFingerprint.equals(messageFingerprint)) {
+ keyType.setText(R.string.otr_fingerprint_selected_message);
+ keyType.setTextColor(getResources().getColor(R.color.accent));
+ } else {
+ keyType.setText(R.string.otr_fingerprint);
+ }
keys.addView(view);
removeButton.setOnClickListener(new OnClickListener() {
@@ -447,7 +452,10 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
View view = inflater.inflate(R.layout.contact_key, keys, false);
TextView key = (TextView) view.findViewById(R.id.key);
TextView keyType = (TextView) view.findViewById(R.id.key_type);
- keyType.setText("PGP Key ID");
+ keyType.setText(R.string.openpgp_key_id);
+ if ("pgp".equals(messageFingerprint)) {
+ keyType.setTextColor(getResources().getColor(R.color.accent));
+ }
key.setText(OpenPgpUtils.convertKeyIdToHex(contact.getPgpKeyId()));
view.setOnClickListener(new OnClickListener() {
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 9c2a7d08..eef7e703 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -449,7 +449,14 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
} else {
if (!message.getContact().isSelf()) {
- activity.switchToContactDetails(message.getContact(), message.getFingerprint());
+ String fingerprint;
+ if (message.getEncryption() == Message.ENCRYPTION_PGP
+ || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) {
+ fingerprint = "pgp";
+ } else {
+ fingerprint = message.getFingerprint();
+ }
+ activity.switchToContactDetails(message.getContact(), fingerprint);
}
}
} else {
@@ -461,7 +468,14 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
} else {
intent = new Intent(activity, EditAccountActivity.class);
intent.putExtra("jid", account.getJid().toBareJid().toString());
- intent.putExtra("fingerprint", message.getFingerprint());
+ String fingerprint;
+ if (message.getEncryption() == Message.ENCRYPTION_PGP
+ || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) {
+ fingerprint = "pgp";
+ } else {
+ fingerprint = message.getFingerprint();
+ }
+ intent.putExtra("fingerprint", fingerprint);
}
startActivity(intent);
}