Skip to content

Commit d347cf5

Browse files
Allow internal users to accept both backup capabilities.
1 parent 834c8c9 commit d347cf5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/src/main/java/org/thoughtcrime/securesms/backup/v2/exporters/ChatItemArchiveExporter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ private fun LinkPreview.toRemoteLinkPreview(mediaArchiveEnabled: Boolean): org.t
771771
}
772772

773773
private fun BackupMessageRecord.toRemoteViewOnceMessage(mediaArchiveEnabled: Boolean, reactionRecords: List<ReactionRecord>?, attachments: List<DatabaseAttachment>?): ViewOnceMessage {
774-
val attachment: DatabaseAttachment? = attachments?.firstOrNull()?.takeUnless { !it.hasData && it.size == 0L && it.archiveMediaId == null && it.width == 0 && it.height == 0 && it.blurHash == null}
774+
val attachment: DatabaseAttachment? = attachments?.firstOrNull()?.takeUnless { !it.hasData && it.size == 0L && it.archiveMediaId == null && it.width == 0 && it.height == 0 && it.blurHash == null }
775775

776776
return ViewOnceMessage(
777777
attachment = attachment?.toRemoteMessageAttachment(mediaArchiveEnabled),

app/src/main/java/org/thoughtcrime/securesms/linkdevice/LinkDeviceViewModel.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,14 @@ class LinkDeviceViewModel : ViewModel() {
407407
LinkedDeviceInactiveCheckJob.enqueue()
408408
}
409409

410-
private fun Uri.supportsLinkAndSync(): Boolean = this.getQueryParameter("capabilities")?.split(",")?.contains("backup") == true
410+
private fun Uri.supportsLinkAndSync(): Boolean {
411+
return if (RemoteConfig.internalUser) {
412+
this.getQueryParameter("capabilities")?.split(",")?.contains("backup") == true ||
413+
this.getQueryParameter("capabilities")?.split(",")?.contains("backup2") == true
414+
} else {
415+
this.getQueryParameter("capabilities")?.split(",")?.contains("backup") == true
416+
}
417+
}
411418

412419
fun onSyncErrorIgnored() = viewModelScope.launch(Dispatchers.IO) {
413420
val dialogState = _state.value.dialogState

0 commit comments

Comments
 (0)