mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd:Ⓜ️:media::file: Adjust download overloads; fix use of empty remote string in messages.
This commit is contained in:
parent
05131c1bbe
commit
0fb19b85ca
2 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue