0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-25 21:38:18 +02:00

ircd:Ⓜ️:media::file: Adjust download overloads; fix use of empty remote string in messages.

This commit is contained in:
Jason Volk 2020-03-13 12:15:15 -07:00
parent 05131c1bbe
commit 0fb19b85ca
2 changed files with 9 additions and 6 deletions

View file

@ -29,7 +29,7 @@ namespace ircd::m::media::file
room::id::buf
download(const mxc &,
const m::user::id &,
const string_view & = {});
const string_view &remote = {});
std::pair<http::response::head, unique_buffer<mutable_buffer>>
download(const mutable_buffer &head_buf,
@ -40,8 +40,8 @@ namespace ircd::m::media::file
m::room
download(const mxc &mxc,
const m::user::id &user_id,
const string_view &remote,
const m::room::id &room_id);
const m::room::id &room_id,
string_view remote = {});
};
namespace ircd::m::media::block

View file

@ -227,7 +227,7 @@ ircd::m::media::file::download(const mxc &mxc,
if(!remote && my_host(mxc.server))
return room_id;
download(mxc, user_id, remote, room_id);
download(mxc, user_id, room_id, remote);
return room_id;
}
@ -235,8 +235,8 @@ ircd::m::room
IRCD_MODULE_EXPORT
ircd::m::media::file::download(const mxc &mxc,
const m::user::id &user_id,
const string_view &remote,
const m::room::id &room_id)
const m::room::id &room_id,
string_view remote)
try
{
auto iit
@ -263,6 +263,9 @@ try
if(exists(room_id))
return room_id;
if(!remote)
remote = mxc.server;
const unique_buffer<mutable_buffer> buf
{
16_KiB