Skip to content

Commit 40666ed

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into refactor/avatar-cleanup
2 parents b80d2f1 + ce78a1e commit 40666ed

File tree

11 files changed

+30
-52
lines changed

11 files changed

+30
-52
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle.properties') }}-${{ matrix.variant }}
3939

4040
- name: Set up JDK 21
41-
uses: actions/setup-java@v4
41+
uses: actions/setup-java@v5
4242
with:
4343
distribution: 'temurin'
4444
java-version: '21'

app/src/main/java/org/session/libsession/avatars/AvatarCacheCleaner.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
package org.session.libsession.avatars
22

33
import android.app.Application
4-
import com.bumptech.glide.Glide
54
import kotlinx.coroutines.CoroutineScope
65
import kotlinx.coroutines.Dispatchers
76
import kotlinx.coroutines.launch
87
import kotlinx.coroutines.withContext
9-
import org.session.libsession.utilities.Address
108
import org.session.libsession.utilities.recipients.RemoteFile
119
import org.session.libsignal.utilities.Log
1210
import org.thoughtcrime.securesms.attachments.RemoteFileDownloadWorker
13-
import org.thoughtcrime.securesms.database.MmsSmsDatabase
1411
import org.thoughtcrime.securesms.database.RecipientSettingsDatabase
1512
import org.thoughtcrime.securesms.dependencies.ManagerScope
1613
import org.thoughtcrime.securesms.glide.RecipientAvatarDownloadManager
@@ -23,7 +20,6 @@ class AvatarCacheCleaner @Inject constructor(
2320
private val application: Application,
2421
private val recipientAvatarDownloadManager: RecipientAvatarDownloadManager,
2522
private val recipientSettingsDatabase: RecipientSettingsDatabase,
26-
private val mmsSmsDatabase: MmsSmsDatabase,
2723
@param:ManagerScope private val coroutineScope: CoroutineScope
2824
) {
2925

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ fun MessageProFeatures(
401401
padding = PaddingValues(),
402402
data = CTAFeature.Icon(
403403
text = when(it){
404-
ProStatusManager.MessageProFeature.ProBadge -> Phrase.from(LocalContext.current, R.string.proBadge)
405-
.put(APP_PRO_KEY, NonTranslatableStringConstants.PRO)
404+
ProStatusManager.MessageProFeature.ProBadge -> Phrase.from(LocalContext.current, R.string.appProBadge)
405+
.put(APP_PRO_KEY, NonTranslatableStringConstants.APP_PRO)
406406
.format()
407407
.toString()
408408
ProStatusManager.MessageProFeature.LongMessage -> stringResource(id = R.string.proIncreasedMessageLengthFeature)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ data class MessageDetailsState(
356356
val proBadgeClickable: Boolean = false,
357357
) {
358358
val fromTitle = GetString(R.string.from)
359-
val canReply: Boolean get() = !readOnly && record?.isOpenGroupInvitation != true
359+
val canReply: Boolean get() = !readOnly && record?.isOpenGroupInvitation != true && error == null
360360
val canDelete: Boolean get() = !readOnly
361361
}
362362

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ fun ConversationSettings(
201201
Text(
202202
modifier = Modifier
203203
.qaTag(R.string.qa_conversation_settings_account_id)
204-
.safeContentWidth()
205204
.pointerInput(Unit) {
206205
detectTapGestures(
207206
onLongPress = { onLongPress() }
@@ -215,7 +214,7 @@ fun ConversationSettings(
215214
},
216215
text = data.displayAccountId,
217216
textAlign = TextAlign.Center,
218-
style = LocalType.current.base.monospace(),
217+
style = LocalType.current.xl.monospace(),
219218
color = LocalColors.current.text
220219
)
221220
}

app/src/main/java/org/thoughtcrime/securesms/database/RecipientSettingsDatabase.kt

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ class RecipientSettingsDatabase @Inject constructor(
4343

4444
// If nothing is updated, return early
4545
if (oldSettings == newSettings) {
46-
Log.d(
47-
TAG,
48-
"No changes to settings for ${address.debugString}, old: $oldSettings, new: $newSettings"
49-
)
46+
Log.d(TAG, "No changes to settings for ${address.debugString}, old: $oldSettings, new: $newSettings")
5047
return
5148
}
5249

@@ -83,11 +80,10 @@ class RecipientSettingsDatabase @Inject constructor(
8380
fun delete(address: Address) {
8481
cache.remove(address)
8582
if (writableDatabase.delete(
86-
TABLE_NAME,
87-
"$COL_ADDRESS = ?",
88-
arrayOf(address.toString())
89-
) > 0
90-
) {
83+
TABLE_NAME,
84+
"$COL_ADDRESS = ?",
85+
arrayOf(address.toString())
86+
) > 0) {
9187
mutableChangeNotification.tryEmit(address)
9288
}
9389
}
@@ -98,10 +94,7 @@ class RecipientSettingsDatabase @Inject constructor(
9894
return existing
9995
}
10096

101-
return readableDatabase.rawQuery(
102-
"SELECT * FROM $TABLE_NAME WHERE $COL_ADDRESS = ?",
103-
address.address
104-
)
97+
return readableDatabase.rawQuery("SELECT * FROM $TABLE_NAME WHERE $COL_ADDRESS = ?", address.address)
10598
.use { cursor ->
10699
// If no settings are saved in the database, return the empty settings, and cache
107100
// that as well so that we don't have to query the database again.
@@ -125,11 +118,7 @@ class RecipientSettingsDatabase @Inject constructor(
125118
keyB64 = getString(getColumnIndexOrThrow(COL_PROFILE_PIC_KEY)),
126119
url = getString(getColumnIndexOrThrow(COL_PROFILE_PIC_URL))
127120
),
128-
blocksCommunityMessagesRequests = getInt(
129-
getColumnIndexOrThrow(
130-
COL_BLOCKS_COMMUNITY_MESSAGES_REQUESTS
131-
)
132-
) == 1,
121+
blocksCommunityMessagesRequests = getInt(getColumnIndexOrThrow(COL_BLOCKS_COMMUNITY_MESSAGES_REQUESTS)) == 1,
133122
name = getString(getColumnIndexOrThrow(COL_NAME)),
134123
proStatus = getString(getColumnIndexOrThrow(COL_PRO_STATUS))
135124
?.let {
@@ -250,15 +239,13 @@ class RecipientSettingsDatabase @Inject constructor(
250239
private const val COL_PROFILE_PIC_KEY = "profile_pic_key_b64"
251240
private const val COL_PROFILE_PIC_URL = "profile_pic_url"
252241
private const val COL_NAME = "name"
253-
private const val COL_BLOCKS_COMMUNITY_MESSAGES_REQUESTS =
254-
"blocks_community_messages_requests"
242+
private const val COL_BLOCKS_COMMUNITY_MESSAGES_REQUESTS = "blocks_community_messages_requests"
255243
private const val COL_PRO_STATUS = "pro_status"
256244

257245
// The time when the profile pic/name/is_pro was last updated, in epoch seconds.
258246
private const val COL_PROFILE_UPDATE_TIME = "profile_update_time"
259247

260-
val MIGRATION_CREATE_TABLE = arrayOf(
261-
"""
248+
val MIGRATION_CREATE_TABLE = arrayOf("""
262249
CREATE TABLE recipient_settings (
263250
$COL_ADDRESS TEXT NOT NULL PRIMARY KEY COLLATE NOCASE,
264251
$COL_MUTE_UNTIL INTEGER NOT NULL DEFAULT 0,

app/src/main/java/org/thoughtcrime/securesms/groups/OpenGroupManager.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
package org.thoughtcrime.securesms.groups
22

3-
import kotlinx.coroutines.CoroutineScope
4-
import kotlinx.coroutines.Dispatchers
53
import kotlinx.coroutines.flow.first
64
import kotlinx.coroutines.flow.mapNotNull
7-
import kotlinx.coroutines.launch
85
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
9-
import org.session.libsession.avatars.AvatarCacheCleaner
106
import org.session.libsession.messaging.open_groups.OpenGroup
117
import org.session.libsession.messaging.open_groups.OpenGroupApi
128
import org.session.libsession.messaging.sending_receiving.pollers.OpenGroupPollerManager
139
import org.session.libsession.snode.utilities.await
1410
import org.session.libsession.utilities.ConfigFactoryProtocol
1511
import org.session.libsignal.utilities.Log
1612
import org.thoughtcrime.securesms.database.LokiAPIDatabase
17-
import org.thoughtcrime.securesms.dependencies.ManagerScope
1813
import javax.inject.Inject
1914
import javax.inject.Singleton
2015

@@ -28,7 +23,6 @@ class OpenGroupManager @Inject constructor(
2823
private val configFactory: ConfigFactoryProtocol,
2924
private val pollerManager: OpenGroupPollerManager,
3025
private val lokiAPIDatabase: LokiAPIDatabase,
31-
private val avatarCacheCleaner: AvatarCacheCleaner,
3226
) {
3327
suspend fun add(server: String, room: String, publicKey: String) {
3428
// Fetch the server's capabilities upfront to see if this server is actually running

app/src/main/res/values-b+ja+JP/strings.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@
292292
<string name="creatingCall">通話を作成中</string>
293293
<string name="cut">切り取り</string>
294294
<string name="databaseErrorClearDataWarning">このデバイス上のすべてのメッセージ、添付ファイル、アカウントデータを削除し、新しいアカウントを作成してもよろしいですか?</string>
295-
<string name="databaseErrorGeneric">データベースエラーが発生しました。\n\n
296-
トラブルシューティングのために、アプリのログをエクスポートして共有してください。この操作が失敗した場合は、{app_name} を再インストールし、アカウントを復元してください。</string>
295+
<string name="databaseErrorGeneric">データベースエラーが発生しました。\n\nトラブルシューティングのために、アプリのログをエクスポートして共有してください。この操作が失敗した場合は、{app_name} を再インストールし、アカウントを復元してください。</string>
297296
<string name="databaseErrorRestoreDataWarning">このデバイス上のすべてのメッセージ、添付ファイル、アカウントデータを削除し、ネットワークからアカウントを復元してもよろしいですか?</string>
298297
<string name="databaseErrorTimeout">{app_name}が起動するのに時間がかかっていることを確認しました。\n\n引き続きお待ちいただくか、トラブルシューティングのためにデバイスログをエクスポートして共有するか、{app_name}を再起動してみてください。</string>
299298
<string name="databaseErrorUpdate">お使いのアプリデータベースはこのバージョンの {app_name} と互換性がありません。アプリを再インストールしてアカウントを復元し、新しいデータベースを生成して {app_name} を使用し続けてください。\n\n警告: これにより、2週間以上前のすべてのメッセージと添付ファイルが失われます。</string>

app/src/main/res/values/strings.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@
307307
<string name="create">Create</string>
308308
<string name="creatingCall">Creating Call</string>
309309
<string name="currentPassword">Current Password</string>
310+
<string name="currentPlan">Current Plan</string>
310311
<string name="cut">Cut</string>
311312
<string name="darkMode">Dark Mode</string>
312313
<string name="databaseErrorClearDataWarning">Are you sure you want to delete all messages, attachments, and account data from this device and create a new account?</string>
@@ -835,8 +836,8 @@
835836
<string name="passwordSetShortDescription">Require password to unlock {app_name} on startup.</string>
836837
<string name="passwordStrengthCharLength">Longer than 12 characters</string>
837838
<string name="passwordStrengthIncludeNumber">Includes a number</string>
838-
<string name="passwordStrengthIncludesLetter">Includes a letter</string>
839839
<string name="passwordStrengthIncludesLowercase">Includes a lowercase letter</string>
840+
<string name="passwordStrengthIncludesSymbol">Includes a symbol</string>
840841
<string name="passwordStrengthIncludesUppercase">Includes a uppercase letter</string>
841842
<string name="passwordStrengthIndicator">Password Strength Indicator</string>
842843
<string name="passwordStrengthIndicatorDescription">Setting a strong password helps protect your messages and attachments if your device is ever lost or stolen.</string>
@@ -908,8 +909,7 @@
908909
<string name="proCallToActionLongerMessages">Want to send longer messages? Send more text and unlock premium features with {app_pro}</string>
909910
<string name="proCallToActionPinnedConversations">Want more pins? Organize your chats and unlock premium features with {app_pro}</string>
910911
<string name="proCallToActionPinnedConversationsMoreThan">Want more than 5 pins? Organize your chats and unlock premium features with {app_pro}</string>
911-
<string name="proDiscountTooltip">Your current plan is already discounted by&amp;#13;
912-
{percent}% of the full {app_pro} price.</string>
912+
<string name="proDiscountTooltip">Your current plan is already discounted by{percent}% of the full {app_pro} price.</string>
913913
<string name="proExpired">Expired</string>
914914
<string name="proExpiredDescription">Unfortunately, your {pro} plan has expired. Renew to keep accessing the exclusive perks and features of {app_pro}.</string>
915915
<string name="proExpiringSoon">Expiring Soon</string>
@@ -934,6 +934,7 @@
934934
<string name="proLongerMessagesDescription">You can send messages up to 10,000 characters in all conversations.</string>
935935
<string name="proLongerMessagesSent">{count} Longer Messages Sent</string>
936936
<string name="proMessageInfoFeatures">This message used the following {app_pro} features:</string>
937+
<string name="proPercentOff">{percent}% Off</string>
937938
<string name="proPinnedConversations">{count} Pinned Conversations</string>
938939
<string name="proPlanActivatedAuto">Your {app_pro} plan is active!\n\nYour plan will automatically renew for another <b>{current_plan}</b> on <b>{date}</b>. Updates to your plan take effect when {pro} is next renewed.</string>
939940
<string name="proPlanActivatedAutoShort">Your {app_pro} plan is active!\n\nYour plan will automatically renew for another <b>{current_plan}</b> on <b>{date}</b>.</string>
@@ -953,9 +954,9 @@
953954
<string name="proPlanRestored">{pro} Plan Restored</string>
954955
<string name="proPlanRestoredDescription">A valid plan for {app_pro} was detected and your {pro} status has been restored!</string>
955956
<string name="proPlanSignUp">Because you originally signed up for {app_pro} via the {platform_store} Store, you\'ll need to use your {platform_account} to update your plan.</string>
956-
<string name="proPriceOneMonth">1 Month - {monthlyPrice} / Month</string>
957-
<string name="proPriceThreeMonths">3 Months - {monthlyPrice} / Month</string>
958-
<string name="proPriceTwelveMonths">12 Months - {monthlyPrice} / Month</string>
957+
<string name="proPriceOneMonth">1 Month - {monthly_price} / Month</string>
958+
<string name="proPriceThreeMonths">3 Months - {monthly_price} / Month</string>
959+
<string name="proPriceTwelveMonths">12 Months - {monthly_price} / Month</string>
959960
<string name="proRefundDescription">We’re sorry to see you go. Here\'s what you need to know before requesting a refund.</string>
960961
<string name="proRefundNextSteps">{platform_account} is now processing your refund request. This typically takes 24-48 hours. Depending on their decision, you may see your {pro} status change in {app_name}.</string>
961962
<string name="proRefundRequestSessionSupport">Your refund request will be handled by {app_name} Support.\n\nRequest a refund by hitting the button below and completing the refund request form.\n\nWhile {app_name} Support strives to process refund requests within 24-72 hours, processing may take longer during times of high request volume.</string>
@@ -969,9 +970,11 @@
969970
<string name="proStats">Your {pro} Stats</string>
970971
<string name="proStatsTooltip">{pro} stats reflect usage on this device and may appear differently on linked devices</string>
971972
<string name="proSupportDescription">Need help with your {pro} plan? Submit a request to the support team.</string>
972-
<string name="proTosPrivacy">By updating, you agree to the {app_pro} <b>Terms of Service</b> and <b>Privacy Policy</b></string>
973+
<string name="proTosPrivacy">By updating, you agree to the {app_pro} <b>Terms of Service</b> {icon} and <b>Privacy Policy</b> {icon}</string>
973974
<string name="proUnlimitedPins">Unlimited Pins</string>
974975
<string name="proUnlimitedPinsDescription">Organize all your chats with unlimited pinned conversations.</string>
976+
<string name="proUpdatePlanDescription">You are currently on the <b>{current_plan} Plan</b>. Are you sure you want to switch to the <b>{selected_plan} Plan</b>?\n\nBy updating, your plan will automatically renew on <b>{date}</b> for an additional {selected_plan} of {pro} access.</string>
977+
<string name="proUpdatePlanExpireDescription">Your plan will expire on <b>{date}</b>.\n\nBy updating, your plan will automatically renew on <b>{date}</b> for an additional {selected_plan} of Pro access.</string>
975978
<string name="proUserProfileModalCallToAction">Want to get more out of {app_name}? Upgrade to {app_pro} for a more powerful messaging experience.</string>
976979
<string name="processingRefundRequest">{platform_account} is processing your refund request</string>
977980
<string name="profile">Profile</string>

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
#Mon Jun 26 09:56:43 AEST 2023
1414
android.enableJetifier=false
1515

16-
org.gradle.jvmargs=-Xmx3072m
16+
org.gradle.jvmargs=-Xmx4096m
1717

1818
# Limit the worker threads to avoid consuming too much memory
1919
org.gradle.workers.max=4
2020
org.gradle.worker.heap.size=512m
2121

22-
kotlin.daemon.jvmargs=-Xmx3072m
22+
kotlin.daemon.jvmargs=-Xmx4096m
2323

2424
android.useAndroidX=true
2525
android.nonTransitiveRClass=false

0 commit comments

Comments
 (0)