fix: save to download

This commit is contained in:
xtaodada 2023-10-29 23:05:28 +08:00
parent 03cf279583
commit bed2005e2e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 3 additions and 3 deletions

View File

@ -4150,7 +4150,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
TLRPC.Document document = message.getDocument();
if (!TextUtils.isEmpty(FileLoader.getDocumentFileName(document)) && FileLoader.canSaveAsFile(message)) {
String filename = FileLoader.getDocumentFileName(document);
File newDir = FileLoader.getDirectory(FileLoader.MEDIA_DIR_FILES);
File newDir = FileLoader.getDirectory(FileLoader.MEDIA_DIR_DOCUMENT);
if (newDir != null) {
path = new File(newDir, filename).getAbsolutePath();
}

View File

@ -27963,7 +27963,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
messageObjects.add(selectedObject);
}
MediaController.saveFilesFromMessages(getParentActivity(), getAccountInstance(), messageObjects, (count) -> {
if (getParentActivity() == null || fragmentView == null) {
if (getParentActivity() == null) {
return;
}
if (count > 0) {
@ -27989,7 +27989,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
path = getFileLoader().getPathToMessage(selectedObject.messageOwner).toString();
}
MediaController.saveFile(path, getParentActivity(), 2, fileName, selectedObject.getDocument() != null ? selectedObject.getDocument().mime_type : "", uri -> {
if (getParentActivity() == null || fragmentView == null) {
if (getParentActivity() == null) {
return;
}
final BulletinFactory.FileType fileType;