mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 21:59:02 +02:00
modules/media/upload: Checkpoint rename to hash fwiw.
This commit is contained in:
parent
ceac1d96ac
commit
3cc3f6da3d
1 changed files with 10 additions and 2 deletions
|
@ -115,12 +115,20 @@ post__upload(client &client,
|
|||
char hashbuf[32];
|
||||
hash.digest(hashbuf);
|
||||
|
||||
char uribuf[256], b58buf[64];
|
||||
char b58buf[64];
|
||||
const auto new_path
|
||||
{
|
||||
b58encode(b58buf, hashbuf)
|
||||
};
|
||||
|
||||
fs::rename(path, new_path);
|
||||
|
||||
char uribuf[256];
|
||||
const string_view content_uri
|
||||
{
|
||||
fmt::sprintf
|
||||
{
|
||||
uribuf, "mxc://%s/%s", my_host(), b58encode(b58buf, hashbuf)
|
||||
uribuf, "mxc://%s/%s", my_host(), new_path
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue