mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
Fix most of import/export integration tests.
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user