mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
use constant to access URI filename
This commit is contained in:
@@ -35,7 +35,7 @@ public class PersistentBlobProvider {
|
||||
public static final String EXPECTED_PATH_NEW = "capture-new/*/*/*/*/#";
|
||||
|
||||
private static final int MIMETYPE_PATH_SEGMENT = 1;
|
||||
private static final int FILENAME_PATH_SEGMENT = 2;
|
||||
public static final int FILENAME_PATH_SEGMENT = 2;
|
||||
private static final int FILESIZE_PATH_SEGMENT = 3;
|
||||
|
||||
private static final String BLOB_EXTENSION = "blob";
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.b44t.messenger.DcMsg;
|
||||
import org.thoughtcrime.securesms.ConversationListRelayingActivity;
|
||||
import org.thoughtcrime.securesms.connect.DcHelper;
|
||||
import org.thoughtcrime.securesms.mms.PartAuthority;
|
||||
import org.thoughtcrime.securesms.providers.PersistentBlobProvider;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
@@ -112,7 +113,7 @@ public class SendRelayedMessageUtil {
|
||||
private static String getRealPathFromUri(Context context, Uri uri) throws NullPointerException {
|
||||
DcContext dcContext = DcHelper.getContext(context);
|
||||
try {
|
||||
String filename = uri.getPathSegments().get(2); // Get real file name from Uri
|
||||
String filename = uri.getPathSegments().get(PersistentBlobProvider.FILENAME_PATH_SEGMENT);
|
||||
String ext = "";
|
||||
int i = filename.lastIndexOf(".");
|
||||
if (i >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user