Enhance text context for thread migration notice

This commit is contained in:
ariskotsomitopoulos 2022-03-18 11:58:29 +01:00
parent a0e6dd5f6c
commit f00b1f29bf
4 changed files with 6 additions and 9 deletions

View File

@ -277,7 +277,6 @@ class HomeActivity :
* sync and display existing messages appropriately
*/
private fun migrateThreadsIfNeeded(checkSession: Boolean) {
if (checkSession) {
// We should check session to ensure we will only clear cache if needed
val args = intent.getParcelableExtra<HomeActivityArgs>(Mavericks.KEY_ARG)
@ -308,10 +307,10 @@ class HomeActivity :
private fun handleNotifyUserForThreadsMigration() {
MaterialAlertDialogBuilder(this)
.setTitle("Threads, no longer experimental")
.setMessage("All \uD83C\uDF89 \uD83C\uDF89 threads created during experimental period will\n\n now be rendered as regular replies. This will be an one-off transition, as threads are now part of the matrix specification")
.setTitle(R.string.threads_notice_migration_title)
.setMessage(R.string.threads_notice_migration_message)
.setCancelable(true)
.setPositiveButton(R.string.ok) { _, _ -> }
.setPositiveButton(R.string.sas_got_it) { _, _ -> }
.show()
}

View File

@ -27,5 +27,4 @@ sealed interface HomeActivityViewEvents : VectorViewEvents {
object ShowAnalyticsOptIn : HomeActivityViewEvents
object NotifyUserForThreadsMigration : HomeActivityViewEvents
data class MigrateThreads(val checkSession: Boolean) : HomeActivityViewEvents
}

View File

@ -140,7 +140,6 @@ class HomeActivityViewModel @AssistedInject constructor(
* - Handle migration when threads are enabled by default
*/
private fun initThreadsMigration() {
// Notify users
if (vectorPreferences.shouldNotifyUserAboutThreads() && vectorPreferences.areThreadMessagesEnabled()) {
Timber.i("----> Notify users about threads")
@ -168,13 +167,11 @@ class HomeActivityViewModel @AssistedInject constructor(
// vectorPreferences.setThreadMessagesEnabled()
// lightweightSettingsStorage.setThreadMessagesEnabled(vectorPreferences.areThreadMessagesEnabled())
// }
if(vectorPreferences.shouldMigrateThreads() && vectorPreferences.areThreadMessagesEnabled()){
if (vectorPreferences.shouldMigrateThreads() && vectorPreferences.areThreadMessagesEnabled()) {
Timber.i("----> Try to migrate threads")
_viewEvents.post(HomeActivityViewEvents.MigrateThreads(checkSession = true))
return
}
}
private fun observeInitialSync() {

View File

@ -731,6 +731,8 @@
<!-- Parameter %s will be replaced by the value of string reply_in_thread -->
<string name="thread_list_empty_notice">Tip: Long tap a message and use “%s”.</string>
<string name="search_thread_from_a_thread">From a Thread</string>
<string name="threads_notice_migration_title">Threads no longer experimental</string>
<string name="threads_notice_migration_message">All threads created during the experimental period will now be rendered as regular replies.\n\nThis will be a one-off transition, as threads are now part of the Matrix specification.\n\nThank you for helping us test Threads! 🎉</string>
<!-- Search -->
<string name="search_hint">Search</string>