aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-06-16 12:12:24 +0200
committerChristian Schneppe <christian@pix-art.de>2016-06-19 20:12:30 +0200
commitefdbbf1c0703cb8f0a13b9f882eabe2c3d71b4ba (patch)
tree778e6d20ae0d3b3e656ed360f2e0a8b50631b2ae /src
parent87c28ba818428ac2b73a7c9add86de66a6d1d066 (diff)
mark used otr fingprint in contact details and highlight pgp
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java12
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java18
-rw-r--r--src/main/res/values/strings.xml2
3 files changed, 28 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 1e73fc68b..d87b47dd5 100644
--- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -436,8 +436,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() {
@@ -464,7 +469,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 df11918f6..9874db8af 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -460,7 +460,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 {
@@ -472,7 +479,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);
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 9ce66ed2a..778a9d758 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -203,6 +203,8 @@
<string name="openpgp_messages_found">OpenPGP encrypted messages found</string>
<string name="your_fingerprint">Your fingerprint</string>
<string name="otr_fingerprint">OTR fingerprint</string>
+ <string name="otr_fingerprint_selected_message">OTR fingerprint of message</string>
+ <string name="openpgp_key_id">OpenPGP Key ID</string>
<string name="omemo_fingerprint">OMEMO fingerprint</string>
<string name="omemo_fingerprint_x509">v\\OMEMO fingerprint</string>
<string name="omemo_fingerprint_selected_message">OMEMO fingerprint of message</string>