-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat: Deduplicate blob files in the JsonRPC API #6470
base: main
Are you sure you want to change the base?
Conversation
0d5c3ad
to
7663144
Compare
@@ -2157,12 +2157,14 @@ impl CommandApi { | |||
|
|||
// mimics the old desktop call, will get replaced with something better in the composer rewrite, | |||
// the better version will just be sending the current draft, though there will be probably something similar with more options to this for the corner cases like setting a marker on the map | |||
#[allow(clippy::too_many_arguments)] | |||
async fn misc_send_msg( |
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.
Not sure whether it's necessary to change this function and misc_set_draft()
since it's going to be replaced anyway?
Is this function and misc_set_draft()
still in use in the Desktop UI?
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.
Currently it is still used, did a quick grep for miscSetDraft
.
7d67188
to
ba20946
Compare
This makes it so that files will be deduplicated when using the JsonRPC API.
@nicodh and @WofWca you know the Desktop code and how it is using the API, so, you can probably tell me whether this is a good way of changing the JsonRPC code - feel free to push changes directly to this PR here!
This PR here changes the existing functions instead of creating new ones; we can alternatively create new ones if it allows for a smoother transition.
This brings a few changes:
<hash>.<extension>
immediately (previously, the filename on the disk stayed the same)create_message()
, it's better to directly create it in the blobdir, since it doesn't need to be copied.set_file_and_deduplicate()
that replaces the file on an existing message.In order to test whether everything still works, the desktop issue has a list of things to test: deltachat/deltachat-desktop#4498
Core issue: #6265