Allow internal users to accept both backup capabilities.
This commit is contained in:
parent
834c8c969a
commit
d347cf5351
2 changed files with 9 additions and 2 deletions
|
@ -771,7 +771,7 @@ private fun LinkPreview.toRemoteLinkPreview(mediaArchiveEnabled: Boolean): org.t
|
|||
}
|
||||
|
||||
private fun BackupMessageRecord.toRemoteViewOnceMessage(mediaArchiveEnabled: Boolean, reactionRecords: List<ReactionRecord>?, attachments: List<DatabaseAttachment>?): ViewOnceMessage {
|
||||
val attachment: DatabaseAttachment? = attachments?.firstOrNull()?.takeUnless { !it.hasData && it.size == 0L && it.archiveMediaId == null && it.width == 0 && it.height == 0 && it.blurHash == null}
|
||||
val attachment: DatabaseAttachment? = attachments?.firstOrNull()?.takeUnless { !it.hasData && it.size == 0L && it.archiveMediaId == null && it.width == 0 && it.height == 0 && it.blurHash == null }
|
||||
|
||||
return ViewOnceMessage(
|
||||
attachment = attachment?.toRemoteMessageAttachment(mediaArchiveEnabled),
|
||||
|
|
|
@ -407,7 +407,14 @@ class LinkDeviceViewModel : ViewModel() {
|
|||
LinkedDeviceInactiveCheckJob.enqueue()
|
||||
}
|
||||
|
||||
private fun Uri.supportsLinkAndSync(): Boolean = this.getQueryParameter("capabilities")?.split(",")?.contains("backup") == true
|
||||
private fun Uri.supportsLinkAndSync(): Boolean {
|
||||
return if (RemoteConfig.internalUser) {
|
||||
this.getQueryParameter("capabilities")?.split(",")?.contains("backup") == true ||
|
||||
this.getQueryParameter("capabilities")?.split(",")?.contains("backup2") == true
|
||||
} else {
|
||||
this.getQueryParameter("capabilities")?.split(",")?.contains("backup") == true
|
||||
}
|
||||
}
|
||||
|
||||
fun onSyncErrorIgnored() = viewModelScope.launch(Dispatchers.IO) {
|
||||
val dialogState = _state.value.dialogState
|
||||
|
|
Loading…
Add table
Reference in a new issue