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