mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Fix #1347 Draft file name "Unknown".
getManuallyCalculatedSlideInfo() in AttatchmentManager sometimes failed to get a file name. Now, in this case, it is just extracted from the uri.
This commit is contained in:
@@ -60,6 +60,7 @@ import org.thoughtcrime.securesms.util.concurrent.SettableFuture;
|
||||
import org.thoughtcrime.securesms.util.guava.Optional;
|
||||
import org.thoughtcrime.securesms.util.views.Stub;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
@@ -352,6 +353,10 @@ public class AttachmentManager {
|
||||
height = dimens.second;
|
||||
}
|
||||
|
||||
if (fileName == null) {
|
||||
fileName = new File(uri.getPath()).getName();
|
||||
}
|
||||
|
||||
Log.w(TAG, "local slide with size " + mediaSize + " took " + (System.currentTimeMillis() - start) + "ms");
|
||||
return mediaType.createSlide(context, uri, fileName, mimeType, mediaSize, width, height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user