0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd:Ⓜ️:v1: Add overloads to derive query remote from mxids.

This commit is contained in:
Jason Volk 2018-02-25 02:05:43 -08:00
parent 8c24d590a4
commit c41a3dc25c
4 changed files with 34 additions and 7 deletions

View file

@ -50,12 +50,15 @@ struct ircd::m::v1::query::opts
struct ircd::m::v1::query::profile
:query
{
profile(const id::user &user_id, const mutable_buffer &, opts);
profile(const id::user &user_id, const string_view &field, const mutable_buffer &, opts);
profile(const id::user &user_id, const string_view &field, const mutable_buffer &);
profile(const id::user &user_id, const mutable_buffer &, opts);
profile(const id::user &user_id, const mutable_buffer &);
};
struct ircd::m::v1::query::directory
:query
{
directory(const id::room_alias &room_alias, const mutable_buffer &, opts);
directory(const id::room_alias &room_alias, const mutable_buffer &);
};

View file

@ -505,6 +505,15 @@ namespace ircd::m::v1
thread_local char query_arg_buf[1024];
}
ircd::m::v1::query::directory::directory(const id::room_alias &room_alias,
const mutable_buffer &buf)
:directory
{
room_alias, buf, opts{room_alias.host()}
}
{
}
ircd::m::v1::query::directory::directory(const id::room_alias &room_alias,
const mutable_buffer &buf,
opts opts)
@ -521,6 +530,15 @@ ircd::m::v1::query::directory::directory(const id::room_alias &room_alias,
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const mutable_buffer &buf)
:profile
{
user_id, buf, opts{user_id.host()}
}
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const mutable_buffer &buf,
opts opts)
@ -537,6 +555,16 @@ ircd::m::v1::query::profile::profile(const id::user &user_id,
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const string_view &field,
const mutable_buffer &buf)
:profile
{
user_id, field, buf, opts{user_id.host()}
}
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const string_view &field,
const mutable_buffer &buf,

View file

@ -42,11 +42,9 @@ get__directory_room(client &client,
16_KiB
};
m::v1::query::opts opts;
opts.remote = room_alias.host();
m::v1::query::directory federation_request
{
room_alias, buf, opts
room_alias, buf
};
//TODO: conf

View file

@ -161,11 +161,9 @@ get__profile_remote(client &client,
64_KiB
};
m::v1::query::opts opts;
opts.remote = user.user_id.host();
m::v1::query::profile federation_request
{
user.user_id, field, buf, opts
user.user_id, field, buf
};
//TODO: conf