0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-03 01:09:05 +02:00

modules/media/upload: Checkpoint rename to hash fwiw.

This commit is contained in:
Jason Volk 2018-02-26 20:51:42 -08:00
parent ceac1d96ac
commit 3cc3f6da3d

View file

@ -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
}
};