From 985de5aa3c28038a927a1cf95a121a4c12965230 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 30 Oct 2020 13:52:58 +1100 Subject: [PATCH 1/6] Fix share screen bug --- .../securesms/loki/views/UserView.kt | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/org/thoughtcrime/securesms/loki/views/UserView.kt b/src/org/thoughtcrime/securesms/loki/views/UserView.kt index dcce57f610..14614f512c 100644 --- a/src/org/thoughtcrime/securesms/loki/views/UserView.kt +++ b/src/org/thoughtcrime/securesms/loki/views/UserView.kt @@ -66,33 +66,9 @@ class UserView : LinearLayout { val threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(user) MentionManagerUtilities.populateUserPublicKeyCacheIfNeeded(threadID, context) // FIXME: This is a bad place to do this val address = user.address.serialize() - if (user.isGroupRecipient) { - if ("Session Public Chat" == user.name || user.address.isRSSFeed) { - profilePictureView.publicKey = "" - profilePictureView.displayName = null - profilePictureView.additionalPublicKey = null - profilePictureView.isRSSFeed = true - } else { - val threadID = GroupManager.getThreadIDFromGroupID(address, context) - val users = MentionsManager.shared.userPublicKeyCache[threadID]?.toList() ?: listOf() - val randomUsers = users.sorted() // Sort to provide a level of stability - val pk = randomUsers.getOrNull(0) ?: "" - profilePictureView.publicKey = pk - profilePictureView.displayName = getUserDisplayName(pk) - val apk = randomUsers.getOrNull(1) ?: "" - profilePictureView.additionalPublicKey = apk - profilePictureView.additionalDisplayName = getUserDisplayName(apk) - profilePictureView.isRSSFeed = false - } - } else { - profilePictureView.publicKey = address - profilePictureView.displayName = getUserDisplayName(address) - profilePictureView.additionalPublicKey = null - profilePictureView.isRSSFeed = false - } - actionIndicatorImageView.setImageResource(R.drawable.ic_baseline_edit_24) profilePictureView.glide = glide - profilePictureView.update() + profilePictureView.update(user, threadID) + actionIndicatorImageView.setImageResource(R.drawable.ic_baseline_edit_24) nameTextView.text = if (user.isGroupRecipient) user.name else getUserDisplayName(address) when (actionIndicator) { ActionIndicator.None -> { From 6bb3cfadedf1322f1210be7a2d2d8da23a4f6787 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 30 Oct 2020 13:53:16 +1100 Subject: [PATCH 2/6] Update build number --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 42156b7aef..c9714b010e 100644 --- a/build.gradle +++ b/build.gradle @@ -190,7 +190,7 @@ dependencies { testImplementation 'org.robolectric:shadows-multidex:4.2' } -def canonicalVersionCode = 116 +def canonicalVersionCode = 117 def canonicalVersionName = "1.6.3" def postFixSize = 10 From 71702badec3a4ba179d4a5c1e75a05ba879f9b0c Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 2 Nov 2020 09:44:30 +1100 Subject: [PATCH 3/6] Fix edit text selection bug --- res/layout-sw400dp/fragment_enter_public_key.xml | 2 +- res/layout/fragment_enter_public_key.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/res/layout-sw400dp/fragment_enter_public_key.xml b/res/layout-sw400dp/fragment_enter_public_key.xml index e09aae2521..9defb4fd35 100644 --- a/res/layout-sw400dp/fragment_enter_public_key.xml +++ b/res/layout-sw400dp/fragment_enter_public_key.xml @@ -14,7 +14,7 @@ android:background="?android:dividerHorizontal" android:elevation="1dp" /> - - Date: Mon, 2 Nov 2020 10:07:11 +1100 Subject: [PATCH 4/6] Update build number --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c9714b010e..f0d9898603 100644 --- a/build.gradle +++ b/build.gradle @@ -190,7 +190,7 @@ dependencies { testImplementation 'org.robolectric:shadows-multidex:4.2' } -def canonicalVersionCode = 117 +def canonicalVersionCode = 118 def canonicalVersionName = "1.6.3" def postFixSize = 10 From b408a408ec7e89cd3ebbe313e62b3fde2341e6d9 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 2 Nov 2020 14:54:10 +1100 Subject: [PATCH 5/6] Implement simple invitation mechanism --- res/layout/activity_settings.xml | 16 ++++++++++++++++ .../loki/activities/SettingsActivity.kt | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/res/layout/activity_settings.xml b/res/layout/activity_settings.xml index 38a27f7168..d393a1cff5 100644 --- a/res/layout/activity_settings.xml +++ b/res/layout/activity_settings.xml @@ -176,6 +176,22 @@ android:gravity="center" android:text="@string/activity_settings_devices_button_title" /> + + + + Date: Wed, 4 Nov 2020 14:49:28 +1100 Subject: [PATCH 6/6] Limit voice messages to one minute --- .../securesms/conversation/ConversationActivity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 12c8e337ce..465de91e5f 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -330,6 +330,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private AttachmentTypeSelector attachmentTypeSelector; private AttachmentManager attachmentManager; private AudioRecorder audioRecorder; + private Handler audioHandler; + private Runnable stopRecordingTask; private BroadcastReceiver securityUpdateReceiver; private Stub emojiDrawerStub; protected HidingLinearLayout quickAttachmentToggle; @@ -2579,6 +2581,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); audioRecorder.startRecording(); + + audioHandler = new Handler(); + stopRecordingTask = () -> inputPanel.onRecordReleased(); + audioHandler.postDelayed(stopRecordingTask, 60000); } @Override @@ -2588,6 +2594,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override public void onRecorderFinished() { + if (audioHandler != null && stopRecordingTask != null) { + audioHandler.removeCallbacks(stopRecordingTask); + } updateToggleButtonState(); Vibrator vibrator = ServiceUtil.getVibrator(this); vibrator.vibrate(20); @@ -2629,6 +2638,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override public void onRecorderCanceled() { + if (audioHandler != null && stopRecordingTask != null) { + audioHandler.removeCallbacks(stopRecordingTask); + } updateToggleButtonState(); Vibrator vibrator = ServiceUtil.getVibrator(this); vibrator.vibrate(50);