From 90d984ee52721f758969894b8e70c53b325f0788 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 4 Apr 2016 12:50:43 -0300 Subject: [PATCH] Ensure responses shown after requests, clarify wording, reuse transactions When devices' clocks are out of sync, it is possible that a response is shown before the request. This commit makes sure that the timestamp of responses is always later than the last message in the conversation. Some wording could be misunderstood to thing introductions were successful even though they were not. That has been clarified. A new database transaction was created when getting contacts and local transport properties. This has been changed to re-use the existing transaction. Also addresses minor issues found in review. --- .../res/layout/list_item_contact.xml | 2 +- .../res/layout/list_item_introduction_in.xml | 4 +- .../res/layout/list_item_introduction_out.xml | 1 - .../res/layout/list_item_notice_in.xml | 1 - .../res/menu/conversation_actions.xml | 2 +- briar-android/res/values/strings.xml | 9 ++-- briar-android/res/values/styles.xml | 2 +- .../android/contact/ConversationActivity.java | 6 ++- .../IntroductionMessageFragment.java | 3 +- .../api/introduction/IntroductionManager.java | 9 ++-- .../properties/TransportPropertyManager.java | 8 ++++ .../introduction/IntroduceeEngine.java | 1 + .../introduction/IntroduceeManager.java | 15 ++++--- .../introduction/IntroducerEngine.java | 3 ++ .../introduction/IntroducerManager.java | 5 ++- .../introduction/IntroductionManagerImpl.java | 23 +++++++---- .../TransportPropertyManagerImpl.java | 41 ++++++++++--------- 17 files changed, 83 insertions(+), 52 deletions(-) diff --git a/briar-android/res/layout/list_item_contact.xml b/briar-android/res/layout/list_item_contact.xml index 78f0681bd..8f879c90a 100644 --- a/briar-android/res/layout/list_item_contact.xml +++ b/briar-android/res/layout/list_item_contact.xml @@ -80,6 +80,6 @@ - + \ No newline at end of file diff --git a/briar-android/res/layout/list_item_introduction_in.xml b/briar-android/res/layout/list_item_introduction_in.xml index 08da32d77..5daea0608 100644 --- a/briar-android/res/layout/list_item_introduction_in.xml +++ b/briar-android/res/layout/list_item_introduction_in.xml @@ -34,8 +34,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/message_bubble_timestamp_margin" - android:layout_alignEnd="@+id/acceptButton" - android:layout_alignRight="@+id/acceptButton" + android:layout_alignEnd="@+id/introductionText" + android:layout_alignRight="@+id/introductionText" android:layout_below="@+id/acceptButton" android:textColor="@color/private_message_date" android:textSize="@dimen/text_size_tiny" diff --git a/briar-android/res/layout/list_item_introduction_out.xml b/briar-android/res/layout/list_item_introduction_out.xml index d3e1a85aa..88070ea66 100644 --- a/briar-android/res/layout/list_item_introduction_out.xml +++ b/briar-android/res/layout/list_item_introduction_out.xml @@ -23,7 +23,6 @@ android:id="@+id/introductionText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:minWidth="175dp" android:textIsSelectable="true" android:textSize="@dimen/text_size_medium" android:textStyle="italic" diff --git a/briar-android/res/layout/list_item_notice_in.xml b/briar-android/res/layout/list_item_notice_in.xml index e7c912f91..8f0daa026 100644 --- a/briar-android/res/layout/list_item_notice_in.xml +++ b/briar-android/res/layout/list_item_notice_in.xml @@ -14,7 +14,6 @@ android:id="@+id/noticeText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:minWidth="80dp" android:textIsSelectable="true" android:textSize="@dimen/text_size_medium" android:textStyle="italic" diff --git a/briar-android/res/menu/conversation_actions.xml b/briar-android/res/menu/conversation_actions.xml index 01090aaec..0128ee56f 100644 --- a/briar-android/res/menu/conversation_actions.xml +++ b/briar-android/res/menu/conversation_actions.xml @@ -6,7 +6,7 @@ Wi-Fi No data an unknown app - Make Introduction - Select contact + + + Select Contact Introduce Contacts You can compose a message that will be sent to %1$s and %2$s along with your introduction: Type message (optional) @@ -151,10 +152,10 @@ Error when responding to introduction Warning: Different Identities You are trying to introduce two contacts that you have added with different identities. This might reveal that both identities are yours. - You have introduced %1$s to %2$s. + You have asked to introduce %1$s to %2$s. %1$s introduced you to %2$s. Do you want to add %2$s to your contact list? %1$s introduced you to %2$s, but %2$s is already in your contact list. Since %1$s might not know that, you can still respond: - %1$s introduced you to %2$s. + %1$s has asked to introduce you to %2$s. You accepted the introduction to %1$s. You declined the introduction to %1$s. %1$s accepted to be introduced to %2$s. diff --git a/briar-android/res/values/styles.xml b/briar-android/res/values/styles.xml index 9b4ebbf6c..12c1c3597 100644 --- a/briar-android/res/values/styles.xml +++ b/briar-android/res/values/styles.xml @@ -99,7 +99,7 @@ 1px -