diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/FileBackend.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java index b71c10cf5..21fa21b46 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -286,12 +286,14 @@ public class FileBackend { public boolean useFileAsIs(Uri uri) { String path = getOriginalPath(uri); if (path == null) { + Log.d(Config.LOGTAG, "File path = null"); return false; } if (path.contains(getDirectoryName("null", true))) { - Log.d(Config.LOGTAG, "File " + path + " is in our directory, sending as is"); + Log.d(Config.LOGTAG, "File " + path + " is in our directory"); return true; } + Log.d(Config.LOGTAG, "File " + path + " is not in our directory"); return false; } diff --git a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java index 3f15fb883..4ad16838c 100644 --- a/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java +++ b/src/main/java/de/pixart/messenger/services/AttachFileToConversationRunnable.java @@ -44,10 +44,11 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod final String mimeType = MimeUtils.guessMimeTypeFromUri(mXmppConnectionService, uri); final int autoAcceptFileSize = Config.FILE_SIZE; this.originalFileSize = FileBackend.getFileSize(mXmppConnectionService, uri); - this.isVideoMessage = (mimeType != null && mimeType.startsWith("video/") + this.isVideoMessage = !getFileBackend().useFileAsIs(uri) + && (mimeType != null && mimeType.startsWith("video/") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) - && originalFileSize > autoAcceptFileSize - && !getFileBackend().useFileAsIs(uri); + && originalFileSize > autoAcceptFileSize; + } public boolean isVideoMessage() { |