Fix compilation warnings
This commit is contained in:
parent
9092b97fb8
commit
3dc5ef54ab
|
@ -134,7 +134,7 @@ data class Event(
|
|||
}
|
||||
|
||||
fun toContentStringWithIndent(): String {
|
||||
val contentMap = toContent()?.toMutableMap() ?: HashMap()
|
||||
val contentMap = toContent().toMutableMap()
|
||||
return JSONObject(contentMap).toString(4)
|
||||
}
|
||||
|
||||
|
|
|
@ -244,13 +244,6 @@ internal class MXMegolmDecryption(private val userId: String,
|
|||
keysClaimed = event.getKeysClaimed().toMutableMap()
|
||||
}
|
||||
|
||||
if (roomKeyContent.sessionId == null
|
||||
|| roomKeyContent.sessionKey == null
|
||||
|| roomKeyContent.roomId == null) {
|
||||
Timber.e("## invalid roomKeyContent")
|
||||
return
|
||||
}
|
||||
|
||||
val added = olmDevice.addInboundGroupSession(roomKeyContent.sessionId,
|
||||
roomKeyContent.sessionKey,
|
||||
roomKeyContent.roomId,
|
||||
|
|
|
@ -66,7 +66,7 @@ internal class MXOlmEncryption(
|
|||
)
|
||||
|
||||
messageEncrypter.encryptMessage(messageMap, deviceInfos)
|
||||
return messageMap.toContent()!!
|
||||
return messageMap.toContent()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -126,7 +126,7 @@ fun getFileExtension(fileUri: String): String? {
|
|||
* Size
|
||||
* ========================================================================================== */
|
||||
|
||||
fun getSizeOfFiles(context: Context, root: File): Int {
|
||||
fun getSizeOfFiles(root: File): Int {
|
||||
return root.walkTopDown()
|
||||
.onEnter {
|
||||
Timber.v("Get size of ${it.absolutePath}")
|
||||
|
|
|
@ -185,8 +185,7 @@ class VectorSettingsGeneralFragment : VectorSettingsBaseFragment() {
|
|||
|
||||
// clear medias cache
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_CLEAR_MEDIA_CACHE_PREFERENCE_KEY)!!.let {
|
||||
val size = getSizeOfFiles(requireContext(),
|
||||
File(requireContext().cacheDir, DiskCache.Factory.DEFAULT_DISK_CACHE_DIR))
|
||||
val size = getSizeOfFiles(File(requireContext().cacheDir, DiskCache.Factory.DEFAULT_DISK_CACHE_DIR))
|
||||
|
||||
it.summary = TextUtils.formatFileSize(requireContext(), size.toLong())
|
||||
|
||||
|
@ -203,8 +202,7 @@ class VectorSettingsGeneralFragment : VectorSettingsBaseFragment() {
|
|||
// On BG thread
|
||||
Glide.get(requireContext()).clearDiskCache()
|
||||
|
||||
newSize = getSizeOfFiles(requireContext(),
|
||||
File(requireContext().cacheDir, DiskCache.Factory.DEFAULT_DISK_CACHE_DIR))
|
||||
newSize = getSizeOfFiles(File(requireContext().cacheDir, DiskCache.Factory.DEFAULT_DISK_CACHE_DIR))
|
||||
}
|
||||
|
||||
it.summary = TextUtils.formatFileSize(requireContext(), newSize.toLong())
|
||||
|
|
Loading…
Reference in New Issue