-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Use getFilename() instead of the actual filename on disk #3521
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…as always null" We will unfortunately need getManuallyCalculatedSlideInfo() with `msg` param This reverts commit 60e8248.
This fixes a bug introduced in 14f69f8: When you drafted an image, pressed Back, and opened the chat again, then the height of the drafted image was wrong and tapping the image opened a preview for the wrong image. I do think that theoretically it would be nicer to use getSlideForMsg here, because we already have a DcMsg, but this didn't work because a) the width and height wasn't gotten from the msg and instead 0 was passed and b) the code tries to save a msgId instead of the message instead, and loading the message from the database fails later since it's just a draft. I didn't want to try and fix these things, because they might be bigger refactorings and I don't know the code.
This comment was marked as outdated.
This comment was marked as outdated.
DcHelper.sharedFiles.put("/" + pngImage, 1); | ||
DcHelper.sharedFiles.put(pngImage, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For explanation: Since AttachmentsContentProvider.openFile()
(which checks sharedFiles
) now uses getPathSegments().get(0);
instead of getPath();
, the leading /
won't be included there. So, it's easier for AttachmentsContentProvider.openFile()
to have it without the leading /
.
To test the changes in this pull request, install this apk: |
In preparation for deltachat/deltachat-core-rust#6332, use the original name of the file (as returned by getFilename()) instead of the current filename on disk.
Most of the commits are cherry-picked from #3513.
What I did:
Known bugs:
The height isn't correctly for image and video drafts calculated becausegetManuallyCalculatedSlideInfo()
isn't called, so that DcAttachment gets width and height 0When tapping the preview of a draft image, a wrong image is shown