Skip to content

Commit b97760f

Browse files
Merge branch 'dev' into release/1.28.1
2 parents 3f11fd3 + c1140f4 commit b97760f

File tree

55 files changed

+2336
-841
lines changed

Some content is hidden

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

55 files changed

+2336
-841
lines changed

app/src/main/java/org/session/libsession/utilities/StringSubKeys.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ object StringSubstitutionConstants {
4747
const val VERSION_KEY: StringSubKey = "version"
4848
const val LIMIT_KEY: StringSubKey = "limit"
4949
const val STORE_VARIANT_KEY: StringSubKey = "storevariant"
50+
const val BUILD_VARIANT_KEY: StringSubKey = "build_variant"
5051
const val APP_PRO_KEY: StringSubKey = "app_pro"
5152
const val PRO_KEY: StringSubKey = "pro"
5253
const val CURRENT_PLAN_KEY: StringSubKey = "current_plan"
5354
const val SELECTED_PLAN_KEY: StringSubKey = "selected_plan"
55+
const val PLATFORM_KEY: StringSubKey = "platform"
5456
const val PLATFORM_STORE_KEY: StringSubKey = "platform_store"
57+
const val PLATFORM_STORE2_KEY: StringSubKey = "platform_store_other"
5558
const val PLATFORM_ACCOUNT_KEY: StringSubKey = "platform_account"
5659
const val MONTHLY_PRICE_KEY: StringSubKey = "monthly_price"
5760
const val PRICE_KEY: StringSubKey = "price"

app/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import org.session.libsession.utilities.TextSecurePreferences.Companion.ENVIRONM
2828
import org.session.libsession.utilities.TextSecurePreferences.Companion.FOLLOW_SYSTEM_SETTINGS
2929
import org.session.libsession.utilities.TextSecurePreferences.Companion.FORCED_SHORT_TTL
3030
import org.session.libsession.utilities.TextSecurePreferences.Companion.HAS_HIDDEN_MESSAGE_REQUESTS
31+
import org.session.libsession.utilities.TextSecurePreferences.Companion.HAS_SEEN_PRO_EXPIRED
32+
import org.session.libsession.utilities.TextSecurePreferences.Companion.HAS_SEEN_PRO_EXPIRING
3133
import org.session.libsession.utilities.TextSecurePreferences.Companion.HAVE_SHOWN_A_NOTIFICATION_ABOUT_TOKEN_PAGE
3234
import org.session.libsession.utilities.TextSecurePreferences.Companion.HIDE_PASSWORD
3335
import org.session.libsession.utilities.TextSecurePreferences.Companion.LAST_VACUUM_TIME
@@ -174,6 +176,10 @@ interface TextSecurePreferences {
174176
fun setForceIncomingMessagesAsPro(isPro: Boolean)
175177
fun forcePostPro(): Boolean
176178
fun setForcePostPro(postPro: Boolean)
179+
fun hasSeenProExpiring(): Boolean
180+
fun setHasSeenProExpiring()
181+
fun hasSeenProExpired(): Boolean
182+
fun setHasSeenProExpired()
177183
fun watchPostProStatus(): StateFlow<Boolean>
178184
fun setShownCallWarning(): Boolean
179185
fun setShownCallNotification(): Boolean
@@ -306,6 +312,8 @@ interface TextSecurePreferences {
306312
const val SET_FORCE_OTHER_USERS_PRO = "pref_force_other_users_pro"
307313
const val SET_FORCE_INCOMING_MESSAGE_PRO = "pref_force_incoming_message_pro"
308314
const val SET_FORCE_POST_PRO = "pref_force_post_pro"
315+
const val HAS_SEEN_PRO_EXPIRING = "has_seen_pro_expiring"
316+
const val HAS_SEEN_PRO_EXPIRED = "has_seen_pro_expired"
309317
const val CALL_NOTIFICATIONS_ENABLED = "pref_call_notifications_enabled"
310318
const val SHOWN_CALL_WARNING = "pref_shown_call_warning" // call warning is user-facing warning of enabling calls
311319
const val SHOWN_CALL_NOTIFICATION = "pref_shown_call_notification" // call notification is a prompt to check privacy settings
@@ -1558,6 +1566,22 @@ class AppTextSecurePreferences @Inject constructor(
15581566
_events.tryEmit(SET_FORCE_POST_PRO)
15591567
}
15601568

1569+
override fun hasSeenProExpiring(): Boolean {
1570+
return getBooleanPreference(HAS_SEEN_PRO_EXPIRING, false)
1571+
}
1572+
1573+
override fun setHasSeenProExpiring() {
1574+
setBooleanPreference(HAS_SEEN_PRO_EXPIRING, true)
1575+
}
1576+
1577+
override fun hasSeenProExpired(): Boolean {
1578+
return getBooleanPreference(HAS_SEEN_PRO_EXPIRED, false)
1579+
}
1580+
1581+
override fun setHasSeenProExpired() {
1582+
setBooleanPreference(HAS_SEEN_PRO_EXPIRED, true)
1583+
}
1584+
15611585
override fun watchPostProStatus(): StateFlow<Boolean> {
15621586
return postProLaunchState
15631587
}

app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/DisappearingMessagesActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package org.thoughtcrime.securesms.conversation.disappearingmessages
22

33
import androidx.compose.runtime.Composable
44
import androidx.core.content.IntentCompat
5-
import androidx.hilt.navigation.compose.hiltViewModel
5+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
66
import dagger.hilt.android.AndroidEntryPoint
77
import network.loki.messenger.BuildConfig
88
import org.session.libsession.messaging.messages.ExpirationConfiguration

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,22 @@ class ConversationActivityV2 : ScreenLockActionBarActivity(), InputBarDelegate,
283283
}
284284

285285
private val address: Address.Conversable by lazy {
286-
requireNotNull(IntentCompat.getParcelableExtra(intent, ADDRESS, Address.Conversable::class.java)) {
287-
"Address must be provided in the intent extras"
286+
val fromExtras =
287+
IntentCompat.getParcelableExtra(intent, ADDRESS, Address.Conversable::class.java)
288+
if (fromExtras != null) {
289+
return@lazy fromExtras
288290
}
291+
292+
// Fallback: parse from URI
293+
val serialized = intent.data?.getQueryParameter(ADDRESS)
294+
if (!serialized.isNullOrEmpty()) {
295+
val parsed = fromSerialized(serialized)
296+
if (parsed is Address.Conversable) {
297+
return@lazy parsed
298+
}
299+
}
300+
301+
throw IllegalArgumentException("Address must be provided in the intent extras or URI")
289302
}
290303

291304
private val viewModel: ConversationViewModel by viewModels(extrasProducer = {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,11 @@ class VisibleMessageView : FrameLayout {
341341

342342
// Set text & icons as appropriate for the message state. Note: Possible message states we care
343343
// about are: isFailed, isSyncFailed, isPending, isSyncing, isResyncing, isRead, and isSent.
344-
messageStatus.messageText?.let{
344+
messageStatus.messageTextRes?.let{
345345
binding.messageStatusTextView.setText(it)
346-
binding.messageStatusTextView.contentDescription = context.getString(R.string.AccessibilityId_send_status) + it
346+
binding.messageStatusTextView.contentDescription =
347+
context.getString(R.string.AccessibilityId_send_status)+
348+
context.getString(it)
347349
}
348350
messageStatus.iconTint?.let(binding.messageStatusTextView::setTextColor)
349351
messageStatus.iconId?.let { ContextCompat.getDrawable(context, it) }
@@ -421,7 +423,7 @@ class VisibleMessageView : FrameLayout {
421423

422424
data class MessageStatusInfo(@DrawableRes val iconId: Int?,
423425
@ColorInt val iconTint: Int?,
424-
@StringRes val messageText: Int?)
426+
@StringRes val messageTextRes: Int?)
425427

426428
private fun getMessageStatusInfo(message: MessageRecord): MessageStatusInfo? = when {
427429
message.isFailed ->

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ import org.thoughtcrime.securesms.conversation.v2.settings.ConversationSettingsV
3737
import org.thoughtcrime.securesms.conversation.v2.settings.ConversationSettingsViewModel.Commands.UpdateGroupName
3838
import org.thoughtcrime.securesms.conversation.v2.settings.ConversationSettingsViewModel.Commands.UpdateNickname
3939
import org.thoughtcrime.securesms.ui.AlertDialog
40+
import org.thoughtcrime.securesms.ui.CTAImage
4041
import org.thoughtcrime.securesms.ui.DialogButtonData
4142
import org.thoughtcrime.securesms.ui.GenericProCTA
4243
import org.thoughtcrime.securesms.ui.GetString
4344
import org.thoughtcrime.securesms.ui.PinProCTA
4445
import org.thoughtcrime.securesms.ui.RadioOption
45-
import org.thoughtcrime.securesms.ui.SimpleSessionProActivatedCTA
46+
import org.thoughtcrime.securesms.ui.SessionProCTA
4647
import org.thoughtcrime.securesms.ui.components.AnnotatedTextWithIcon
4748
import org.thoughtcrime.securesms.ui.components.DialogTitledRadioButton
4849
import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField
@@ -248,9 +249,9 @@ fun ConversationSettingsDialogs(
248249
}
249250

250251
is ConversationSettingsViewModel.ProBadgeCTA.Group -> {
251-
SimpleSessionProActivatedCTA(
252-
heroImage = R.drawable.cta_hero_group,
252+
SessionProCTA(
253253
title = stringResource(R.string.proGroupActivated),
254+
badgeAtStart = true,
254255
textContent = {
255256
AnnotatedTextWithIcon(
256257
modifier = Modifier
@@ -261,6 +262,9 @@ fun ConversationSettingsDialogs(
261262
style = LocalType.current.large,
262263
)
263264
},
265+
content = { CTAImage(heroImage = R.drawable.cta_hero_group) },
266+
positiveButtonText = null,
267+
negativeButtonText = stringResource(R.string.close),
264268
onCancel = {
265269
sendCommand(HideProBadgeCTA)
266270
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import androidx.compose.animation.SharedTransitionLayout
66
import androidx.compose.runtime.Composable
77
import androidx.compose.runtime.LaunchedEffect
88
import androidx.compose.runtime.remember
9-
import androidx.hilt.navigation.compose.hiltViewModel
9+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
1010
import androidx.lifecycle.Lifecycle
1111
import androidx.lifecycle.compose.LocalLifecycleOwner
1212
import androidx.lifecycle.compose.dropUnlessResumed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package org.thoughtcrime.securesms.conversation.v2.settings.notification
22

33
import androidx.compose.runtime.Composable
44
import androidx.core.content.IntentCompat
5-
import androidx.hilt.navigation.compose.hiltViewModel
5+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
66
import dagger.hilt.android.AndroidEntryPoint
77
import org.session.libsession.utilities.Address
88
import org.thoughtcrime.securesms.FullComposeScreenLockActivity

app/src/main/java/org/thoughtcrime/securesms/debugmenu/DebugMenuViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class DebugMenuViewModel @Inject constructor(
9090
DebugSubscriptionStatus.AUTO_APPLE,
9191
DebugSubscriptionStatus.EXPIRING_APPLE,
9292
DebugSubscriptionStatus.EXPIRED,
93+
DebugSubscriptionStatus.EXPIRED_APPLE,
9394
),
9495
selectedDebugSubscriptionStatus = textSecurePreferences.getDebugSubscriptionType() ?: DebugSubscriptionStatus.AUTO_GOOGLE,
9596
debugProPlans = subscriptionManagers.asSequence()
@@ -423,7 +424,8 @@ class DebugMenuViewModel @Inject constructor(
423424
EXPIRING_GOOGLE("Expiring/Cancelled (Google, 12 months)"),
424425
AUTO_APPLE("Auto Renewing (Apple, 1 months)"),
425426
EXPIRING_APPLE("Expiring/Cancelled (Apple, 1 months)"),
426-
EXPIRED("Expired"),
427+
EXPIRED("Expired (Google)"),
428+
EXPIRED_APPLE("Expired (Apple)"),
427429
}
428430

429431
sealed class Commands {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import android.content.Context
44
import android.content.Intent
55
import androidx.compose.runtime.Composable
66
import androidx.core.content.IntentCompat
7-
import androidx.hilt.navigation.compose.hiltViewModel
7+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
88
import dagger.hilt.android.AndroidEntryPoint
99
import org.session.libsession.utilities.Address
1010
import org.thoughtcrime.securesms.FullComposeScreenLockActivity

0 commit comments

Comments
 (0)