Fix most of import/export integration tests.

This commit is contained in:
Clark
2024-06-07 16:18:55 -04:00
committed by Alex Hart
parent d5cd790871
commit e62b8de1bc
4 changed files with 12 additions and 5 deletions

View File

@@ -94,7 +94,7 @@ object BackupRepository {
)
}
val exportState = ExportState(backupTime = System.currentTimeMillis(), allowMediaBackup = true)
val exportState = ExportState(backupTime = System.currentTimeMillis(), allowMediaBackup = SignalStore.backup().backsUpMedia)
writer.use {
writer.write(

View File

@@ -549,13 +549,13 @@ class ChatItemImportInserter(
typeFlags = MessageTypes.PROFILE_CHANGE_TYPE
val profileChangeDetails = ProfileChangeDetails(profileNameChange = ProfileChangeDetails.StringChange(previous = updateMessage.profileChange.previousName, newValue = updateMessage.profileChange.newName))
val messageExtras = MessageExtras(profileChangeDetails = profileChangeDetails).encode()
put(MessageTable.MESSAGE_EXTRAS, Base64.encodeWithPadding(messageExtras))
put(MessageTable.MESSAGE_EXTRAS, messageExtras)
}
updateMessage.learnedProfileChange != null -> {
typeFlags = MessageTypes.PROFILE_CHANGE_TYPE
val profileChangeDetails = ProfileChangeDetails(learnedProfileName = ProfileChangeDetails.LearnedProfileName(e164 = updateMessage.learnedProfileChange.e164?.toString(), username = updateMessage.learnedProfileChange.username))
val messageExtras = MessageExtras(profileChangeDetails = profileChangeDetails).encode()
put(MessageTable.MESSAGE_EXTRAS, Base64.encodeWithPadding(messageExtras))
put(MessageTable.MESSAGE_EXTRAS, messageExtras)
}
updateMessage.sessionSwitchover != null -> {
typeFlags = MessageTypes.SESSION_SWITCHOVER_TYPE or (getAsLong(MessageTable.TYPE) and MessageTypes.BASE_TYPE_MASK.inv())

View File

@@ -116,8 +116,9 @@ class ChatIterator(private val cursor: Cursor) : Iterator<Chat>, Closeable {
null
}
val chatStyleBuilder = ChatStyle.Builder()
var chatStyleBuilder: ChatStyle.Builder? = null
if (chatColors != null) {
chatStyleBuilder = ChatStyle.Builder()
val presetBubbleColor = chatColors.tryToMapToBackupPreset()
if (presetBubbleColor != null) {
chatStyleBuilder.bubbleColorPreset = presetBubbleColor
@@ -139,7 +140,7 @@ class ChatIterator(private val cursor: Cursor) : Iterator<Chat>, Closeable {
muteUntilMs = cursor.requireLong(RecipientTable.MUTE_UNTIL),
markedUnread = ThreadTable.ReadStatus.deserialize(cursor.requireInt(ThreadTable.READ)) == ThreadTable.ReadStatus.FORCED_UNREAD,
dontNotifyForMentionsIfMuted = RecipientTable.MentionSetting.DO_NOT_NOTIFY.id == cursor.requireInt(RecipientTable.MENTION_SETTING),
style = chatStyleBuilder.build()
style = chatStyleBuilder?.build()
)
}

View File

@@ -358,6 +358,11 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
return getBoolean(USER_MANUALLY_CANCELLED, false)
}
@Deprecated("Manual cancellation is stored in InAppPayment records. We should no longer need to set this value.")
fun markUserManuallyCancelled() {
return putBoolean(USER_MANUALLY_CANCELLED, true)
}
@Deprecated("Manual cancellation is stored in InAppPayment records. We no longer need to clear this value.")
fun clearUserManuallyCancelled() {
remove(USER_MANUALLY_CANCELLED)
@@ -459,6 +464,7 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
Log.d(TAG, "[updateLocalStateForManualCancellation] Clearing expired badge.")
setExpiredBadge(null)
}
SignalStore.donationsValues().markUserManuallyCancelled()
}
val subscriber = InAppPaymentsRepository.getSubscriber(subscriberType)