feat: Make dc_msg_get_filename() return the original attachment filename (#4309)

It can be used e.g. as a default in the file saving dialog. Also display the original filename in
the message info. For these purposes add Param::Filename in addition to Param::File and use it as an
attachment filename in sent emails.
This commit is contained in:
iequidoo
2023-07-26 14:28:40 -03:00
committed by iequidoo
parent 2f24eddb7d
commit 55aaec744a
13 changed files with 74 additions and 51 deletions

View File

@@ -49,10 +49,9 @@ class TestOnlineInCreation:
assert str(tmp_path) != ac1.get_blobdir()
src = tmp_path / "file.txt"
src.write_text("hello there\n")
chat.send_file(str(src))
blob_src = os.path.join(ac1.get_blobdir(), "file.txt")
assert os.path.exists(blob_src), "file.txt not copied to blobdir"
msg = chat.send_file(str(src))
assert msg.filename.startswith(os.path.join(ac1.get_blobdir(), "file"))
assert msg.filename.endswith(".txt")
def test_forward_increation(self, acfactory, data, lp):
ac1, ac2 = acfactory.get_online_accounts(2)