Unverified Commit 2e627aaa authored by Filipe de Lima Brito's avatar Filipe de Lima Brito Committed by GitHub

Merge pull request #1596 from RocketChat/fix/file-size-validation

[FIX] File size validation
parents b404ba00 5cf023b3
...@@ -338,12 +338,9 @@ class ChatRoomPresenter @Inject constructor( ...@@ -338,12 +338,9 @@ class ChatRoomPresenter @Inject constructor(
val maxFileSizeAllowed = settings.uploadMaxFileSize() val maxFileSizeAllowed = settings.uploadMaxFileSize()
when { when {
fileName.isEmpty() -> { fileName.isEmpty() -> view.showInvalidFileMessage()
view.showInvalidFileMessage() fileSize > maxFileSizeAllowed && maxFileSizeAllowed !in -1..0 ->
}
fileSize > maxFileSizeAllowed -> {
view.showInvalidFileSize(fileSize, maxFileSizeAllowed) view.showInvalidFileSize(fileSize, maxFileSizeAllowed)
}
else -> { else -> {
var inputStream: InputStream? = uriInteractor.getInputStream(uri) var inputStream: InputStream? = uriInteractor.getInputStream(uri)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment