Skip to content

Commit

Permalink
fix: save to download
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Oct 29, 2023
1 parent 03cf279 commit bed2005
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4150,7 +4150,7 @@ public void start(Context context) {
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();
}
Expand Down
4 changes: 2 additions & 2 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27963,7 +27963,7 @@ private void processSelectedOption(int option) {
messageObjects.add(selectedObject);
}
MediaController.saveFilesFromMessages(getParentActivity(), getAccountInstance(), messageObjects, (count) -> {
if (getParentActivity() == null || fragmentView == null) {
if (getParentActivity() == null) {
return;
}
if (count > 0) {
Expand All @@ -27989,7 +27989,7 @@ private void processSelectedOption(int option) {
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;
Expand Down

0 comments on commit bed2005

Please sign in to comment.