Set conference chat room without any participant as read-only + replaced deprecated function
This commit is contained in:
parent
a437c1f5ef
commit
df396f5abd
7 changed files with 11 additions and 11 deletions
|
@ -233,7 +233,7 @@ class ChatMessageContentData(
|
|||
if (content.isFile || (content.isFileTransfer && chatMessage.isOutgoing)) {
|
||||
val path = if (isFileEncrypted) {
|
||||
Log.i("[Content] Content is encrypted, requesting plain file path")
|
||||
content.plainFilePath
|
||||
content.exportPlainFile()
|
||||
} else {
|
||||
content.filePath ?: ""
|
||||
}
|
||||
|
|
|
@ -1107,7 +1107,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
dialog.dismiss()
|
||||
lifecycleScope.launch {
|
||||
Log.w("[Chat Room] Content is encrypted, requesting plain file path")
|
||||
val plainFilePath = content.plainFilePath
|
||||
val plainFilePath = content.exportPlainFile()
|
||||
Log.i("[Cht Room] Making a copy of [$plainFilePath] to the cache directory before exporting it")
|
||||
val cacheCopyPath = FileUtils.copyFileToCache(plainFilePath)
|
||||
if (cacheCopyPath != null) {
|
||||
|
|
|
@ -128,7 +128,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
|||
|
||||
attachFileEnabled.value = true
|
||||
sendMessageEnabled.value = false
|
||||
isReadOnly.value = chatRoom.isReadOnly
|
||||
isReadOnly.value = chatRoom.isReadOnly || (chatRoom.hasCapability(ChatRoomCapabilities.Conference.toInt()) && chatRoom.participants.isEmpty())
|
||||
|
||||
val recorderParams = coreContext.core.createRecorderParams()
|
||||
if (corePreferences.voiceMessagesFormatMkv) {
|
||||
|
|
|
@ -137,7 +137,7 @@ class TopBarFragment : GenericFragment<FileViewerTopBarFragmentBinding>() {
|
|||
if (mediaStoreFilePath.isEmpty()) {
|
||||
Log.w("[File Viewer] Media store file path is empty, media store export failed?")
|
||||
|
||||
val filePath = content.plainFilePath.orEmpty()
|
||||
val filePath = content.exportPlainFile().orEmpty()
|
||||
plainFilePath = filePath.ifEmpty { content.filePath.orEmpty() }
|
||||
Log.i("[File Viewer] Plain file path is: $plainFilePath")
|
||||
if (plainFilePath.isNotEmpty()) {
|
||||
|
|
|
@ -34,7 +34,7 @@ open class FileViewerViewModel(val content: Content) : ViewModel() {
|
|||
init {
|
||||
filePath = if (deleteAfterUse) {
|
||||
Log.i("[File Viewer] Content is encrypted, requesting plain file path")
|
||||
content.plainFilePath
|
||||
content.exportPlainFile()
|
||||
} else {
|
||||
content.filePath.orEmpty()
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ class Api23Compatibility {
|
|||
return false
|
||||
}
|
||||
|
||||
val plainFilePath = content.plainFilePath.orEmpty()
|
||||
val plainFilePath = content.exportPlainFile().orEmpty()
|
||||
val isVfsEncrypted = plainFilePath.isNotEmpty()
|
||||
Log.w("[Media Store] Content is encrypted, requesting plain file path")
|
||||
val filePath = if (isVfsEncrypted) plainFilePath else content.filePath
|
||||
|
@ -185,7 +185,7 @@ class Api23Compatibility {
|
|||
return false
|
||||
}
|
||||
|
||||
val plainFilePath = content.plainFilePath.orEmpty()
|
||||
val plainFilePath = content.exportPlainFile().orEmpty()
|
||||
val isVfsEncrypted = plainFilePath.isNotEmpty()
|
||||
Log.w("[Media Store] Content is encrypted, requesting plain file path")
|
||||
val filePath = if (isVfsEncrypted) plainFilePath else content.filePath
|
||||
|
@ -224,7 +224,7 @@ class Api23Compatibility {
|
|||
return false
|
||||
}
|
||||
|
||||
val plainFilePath = content.plainFilePath.orEmpty()
|
||||
val plainFilePath = content.exportPlainFile().orEmpty()
|
||||
val isVfsEncrypted = plainFilePath.isNotEmpty()
|
||||
Log.w("[Media Store] Content is encrypted, requesting plain file path")
|
||||
val filePath = if (isVfsEncrypted) plainFilePath else content.filePath
|
||||
|
|
|
@ -99,7 +99,7 @@ class Api29Compatibility {
|
|||
}
|
||||
|
||||
suspend fun addImageToMediaStore(context: Context, content: Content): Boolean {
|
||||
val plainFilePath = content.plainFilePath.orEmpty()
|
||||
val plainFilePath = content.exportPlainFile().orEmpty()
|
||||
val isVfsEncrypted = plainFilePath.isNotEmpty()
|
||||
Log.w("[Media Store] Content is encrypted, requesting plain file path")
|
||||
val filePath = if (isVfsEncrypted) plainFilePath else content.filePath
|
||||
|
@ -135,7 +135,7 @@ class Api29Compatibility {
|
|||
}
|
||||
|
||||
suspend fun addVideoToMediaStore(context: Context, content: Content): Boolean {
|
||||
val plainFilePath = content.plainFilePath.orEmpty()
|
||||
val plainFilePath = content.exportPlainFile().orEmpty()
|
||||
val isVfsEncrypted = plainFilePath.isNotEmpty()
|
||||
Log.w("[Media Store] Content is encrypted, requesting plain file path")
|
||||
val filePath = if (isVfsEncrypted) plainFilePath else content.filePath
|
||||
|
@ -172,7 +172,7 @@ class Api29Compatibility {
|
|||
}
|
||||
|
||||
suspend fun addAudioToMediaStore(context: Context, content: Content): Boolean {
|
||||
val plainFilePath = content.plainFilePath.orEmpty()
|
||||
val plainFilePath = content.exportPlainFile().orEmpty()
|
||||
val isVfsEncrypted = plainFilePath.isNotEmpty()
|
||||
Log.w("[Media Store] Content is encrypted, requesting plain file path")
|
||||
val filePath = if (isVfsEncrypted) plainFilePath else content.filePath
|
||||
|
|
Loading…
Reference in a new issue