Skip to content

Commit b74d35e

Browse files
Merge pull request #1679 from oxen-io/release/1.20.0
Release/1.20.0
2 parents 75c5a75 + e4a8fc2 commit b74d35e

File tree

195 files changed

+5119
-2778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+5119
-2778
lines changed

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
24712471
// Note: The adapter itemCount is zero based - so calling this with the itemCount in
24722472
// a non-zero based manner scrolls us to the bottom of the last message (including
24732473
// to the bottom of long messages as required by Jira SES-789 / GitHub 1364).
2474-
recyclerView.scrollToPosition(adapter.itemCount)
2474+
recyclerView.smoothScrollToPosition(adapter.itemCount)
24752475
}
24762476
}
24772477
}

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/mention/MentionViewModel.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,17 @@ class MentionViewModel(
202202
val sb = StringBuilder()
203203
var offset = 0
204204
for ((span, range) in spansWithRanges) {
205-
// Add content before the mention span
206-
sb.append(editable, offset, range.first)
205+
// Add content before the mention span. There's a possibility of overlapping spans so we need to
206+
// safe guard the start offset here to not go over our span's start.
207+
val thisMentionStart = range.first
208+
val lastMentionEnd = offset.coerceAtMost(thisMentionStart)
209+
sb.append(editable, lastMentionEnd, thisMentionStart)
207210

208211
// Replace the mention span with "@public key"
209212
sb.append('@').append(span.member.publicKey).append(' ')
210213

211-
offset = range.last + 1
214+
// Safe guard offset to not go over the end of the editable.
215+
offset = (range.last + 1).coerceAtMost(editable.length)
212216
}
213217

214218
// Add the remaining content

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/AttachmentManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package org.thoughtcrime.securesms.conversation.v2.utilities;
1818

19-
import static com.google.android.gms.common.util.CollectionUtils.listOf;
2019
import static org.session.libsession.utilities.StringSubstitutionConstants.APP_NAME_KEY;
2120

2221
import android.Manifest;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="50"
5+
android:viewportHeight="50">
6+
<path
7+
android:pathData="M15.575,11.473L30.841,23.853L15.247,36.509C15.053,36.658 14.889,36.848 14.764,37.067C14.639,37.286 14.557,37.529 14.521,37.783C14.484,38.037 14.496,38.296 14.554,38.545C14.613,38.794 14.717,39.028 14.86,39.233C15.003,39.438 15.184,39.61 15.39,39.739C15.596,39.868 15.824,39.951 16.061,39.984C16.298,40.017 16.538,39.999 16.768,39.93C16.998,39.861 17.212,39.744 17.4,39.584L34.455,25.746C34.637,25.594 34.792,25.408 34.91,25.196C34.993,25.112 35.07,25.022 35.14,24.926C35.426,24.518 35.549,24.005 35.482,23.499C35.416,22.994 35.166,22.537 34.787,22.23L17.732,8.391C17.545,8.238 17.331,8.127 17.104,8.063C16.877,7.999 16.64,7.983 16.407,8.018C16.174,8.053 15.95,8.137 15.748,8.265C15.545,8.393 15.368,8.563 15.227,8.766C15.084,8.968 14.98,9.198 14.921,9.444C14.861,9.689 14.847,9.945 14.879,10.197C14.911,10.448 14.99,10.69 15.109,10.909C15.228,11.128 15.386,11.32 15.575,11.473Z"
8+
android:fillColor="?android:textColorPrimary"/>
9+
</vector>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="50"
5+
android:viewportHeight="50">
6+
<path
7+
android:pathData="M34.425,36.527L19.159,24.147L34.753,11.491C34.947,11.342 35.111,11.152 35.236,10.933C35.361,10.714 35.443,10.471 35.479,10.217C35.515,9.963 35.504,9.704 35.446,9.455C35.387,9.206 35.284,8.972 35.14,8.767C34.996,8.562 34.816,8.39 34.61,8.261C34.404,8.132 34.176,8.049 33.939,8.016C33.702,7.983 33.462,8.001 33.232,8.07C33.002,8.139 32.787,8.256 32.6,8.416L15.545,22.254C15.363,22.406 15.208,22.592 15.09,22.804C15.007,22.888 14.93,22.978 14.86,23.074C14.574,23.482 14.451,23.995 14.517,24.501C14.584,25.006 14.834,25.463 15.212,25.77L32.268,39.609C32.455,39.762 32.668,39.873 32.896,39.937C33.123,40.001 33.36,40.016 33.593,39.982C33.826,39.947 34.05,39.863 34.252,39.735C34.455,39.607 34.632,39.437 34.773,39.235C34.916,39.032 35.02,38.802 35.079,38.556C35.139,38.311 35.153,38.055 35.121,37.803C35.089,37.552 35.011,37.31 34.891,37.091C34.772,36.872 34.614,36.68 34.425,36.527Z"
8+
android:fillColor="#000000"/>
9+
</vector>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<solid android:color="?searchBackgroundColor" />
4+
<corners android:topLeftRadius="100dp" android:bottomLeftRadius="100dp" />
5+
</shape>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<solid android:color="?searchBackgroundColor" />
4+
<corners android:topRightRadius="100dp" android:bottomRightRadius="100dp" />
5+
</shape>

app/src/test/java/org/thoughtcrime/securesms/conversation/v2/MentionViewModelTest.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ class MentionViewModelTest {
179179
// Should have normalised message with selected candidate
180180
assertThat(mentionViewModel.normalizeMessageBody())
181181
.isEqualTo("Hi @pubkey1 ")
182+
183+
// Should have correct normalised message even with the last space deleted
184+
editable.delete(editable.length - 1, editable.length)
185+
assertThat(mentionViewModel.normalizeMessageBody())
186+
.isEqualTo("Hi @pubkey1 ")
182187
}
183188
}
184189
}

libsession/src/main/assets/json/time_strings/time_strings_dict_af.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

libsession/src/main/assets/json/time_strings/time_strings_dict_am.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)