aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <inputmice@siacs.eu>2015-01-02 15:14:06 +0100
committerDaniel Gultsch <inputmice@siacs.eu>2015-01-02 15:14:06 +0100
commit1988e244ef035da5ddc309c3ad587f967518509e (patch)
tree285ce0234b94519aa83e93b6c140e73bd61beeb0 /src
parentf58f27a1f74ee37092aa24a1187de32fe7e903ae (diff)
some further otr improvements
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/OtrEngine.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java2
-rw-r--r--src/main/java/eu/siacs/conversations/ui/VerifyOTRActivity.java10
-rw-r--r--src/main/res/menu/verification_choices.xml15
-rw-r--r--src/main/res/menu/verify_otr.xml9
-rw-r--r--src/main/res/values/strings.xml2
6 files changed, 31 insertions, 9 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/OtrEngine.java b/src/main/java/eu/siacs/conversations/crypto/OtrEngine.java
index 64434631c..7f7b350c6 100644
--- a/src/main/java/eu/siacs/conversations/crypto/OtrEngine.java
+++ b/src/main/java/eu/siacs/conversations/crypto/OtrEngine.java
@@ -126,7 +126,7 @@ public class OtrEngine extends OtrCryptoEngineImpl implements OtrEngineHost {
@Override
public byte[] getLocalFingerprintRaw(SessionID arg0) {
try {
- return new OtrCryptoEngineImpl().getFingerprintRaw(getPublicKey());
+ return getFingerprintRaw(getPublicKey());
} catch (OtrCryptoException e) {
return null;
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index d73af194e..93a4cc7ef 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -374,6 +374,8 @@ public class ConversationFragment extends Fragment {
privateMessageWith(message.getCounterpart());
}
}
+ } else {
+ activity.showQrCode();
}
}
});
diff --git a/src/main/java/eu/siacs/conversations/ui/VerifyOTRActivity.java b/src/main/java/eu/siacs/conversations/ui/VerifyOTRActivity.java
index 8fffbaac4..c33decd89 100644
--- a/src/main/java/eu/siacs/conversations/ui/VerifyOTRActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/VerifyOTRActivity.java
@@ -5,12 +5,11 @@ import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
+import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
-import android.widget.ImageView;
import android.widget.LinearLayout;
-import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -411,6 +410,13 @@ public class VerifyOTRActivity extends XmppActivity implements XmppConnectionSer
this.mSmpVerificationArea = (LinearLayout) findViewById(R.id.smp_verification_area);
}
+ @Override
+ public boolean onCreateOptionsMenu(final Menu menu) {
+ super.onCreateOptionsMenu(menu);
+ getMenuInflater().inflate(R.menu.verify_otr, menu);
+ return true;
+ }
+
private void showManuallyVerifyDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.manually_verify);
diff --git a/src/main/res/menu/verification_choices.xml b/src/main/res/menu/verification_choices.xml
new file mode 100644
index 000000000..e833ba79d
--- /dev/null
+++ b/src/main/res/menu/verification_choices.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:id="@+id/scan_fingerprint"
+ android:title="@string/scan_qr_code"/>
+ <item
+ android:id="@+id/ask_question"
+ android:title="@string/ask_question"/>
+
+ <item
+ android:id="@+id/manual_verification"
+ android:title="@string/manually_verify" />
+
+</menu> \ No newline at end of file
diff --git a/src/main/res/menu/verify_otr.xml b/src/main/res/menu/verify_otr.xml
index 1d4a11b6d..42b66ad5b 100644
--- a/src/main/res/menu/verify_otr.xml
+++ b/src/main/res/menu/verify_otr.xml
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:id="@+id/manually_verify"
- android:orderInCategory="10"
- android:showAsAction="never"
- android:title="@string/manually_verify" />
+ <item
+ android:id="@+id/action_show_qr_code"
+ android:title="@string/show_qr_code"
+ android:showAsAction="never" />
<item
android:id="@+id/action_accounts"
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index be548ad4e..1d1f609d3 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -398,5 +398,5 @@
<string name="smp_explain_answer">Your contact would like to verify your fingerprint by challenging you with a shared secret. Your contact provided the following hint or question for that secret.</string>
<string name="shared_secret_hint_should_not_be_empty">Your hint should not be empty</string>
<string name="shared_secret_can_not_be_empty">Your shared secret can not be empty</string>
- <string name="manual_verification_explanation">Carefully compare the fingerprints shown below with the fingerprints of your contact.\nYou can use a trusted communication channel like an encrypted e-mail or a telephone call channel to exchange those.</string>
+ <string name="manual_verification_explanation">Carefully compare the fingerprint shown below with the fingerprint of your contact.\nYou can use any trusted form of communication like an encrypted e-mail or a telephone call to exchange those.</string>
</resources>