refactor: Remove Message.set_file() / dc_msg_set_file() and related code (#6558)

Now that we are deduplicating everywhere, we can get rid of some code.

The old python bindings did not get an optional `name` parameter because
they are deprecated anyway, but it would be easy to add it.
This commit is contained in:
Hocuri
2025-02-22 10:47:52 +01:00
committed by GitHub
parent 253331b7fd
commit a49dfeca6e
9 changed files with 77 additions and 108 deletions

View File

@@ -118,7 +118,7 @@ class Message:
mtype = ffi.NULL if mime_type is None else as_dc_charpointer(mime_type)
if not os.path.exists(path):
raise ValueError(f"path does not exist: {path!r}")
lib.dc_msg_set_file(self._dc_msg, as_dc_charpointer(path), mtype)
lib.dc_msg_set_file_and_deduplicate(self._dc_msg, as_dc_charpointer(path), ffi.NULL, mtype)
@props.with_doc
def basename(self) -> str: