mirror of
https://github.com/matrix-construct/construct
synced 2024-07-06 02:28:38 +02:00
ircd:Ⓜ️:v1: Add additional query::profile field overload.
This commit is contained in:
parent
a25b9c84f5
commit
619a5a6a96
|
@ -51,6 +51,7 @@ struct ircd::m::v1::query::profile
|
||||||
:query
|
:query
|
||||||
{
|
{
|
||||||
profile(const id::user &user_id, const mutable_buffer &, opts);
|
profile(const id::user &user_id, const mutable_buffer &, opts);
|
||||||
|
profile(const id::user &user_id, const string_view &field, const mutable_buffer &, opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ircd::m::v1::query::directory
|
struct ircd::m::v1::query::directory
|
||||||
|
|
20
ircd/m/v1.cc
20
ircd/m/v1.cc
|
@ -537,6 +537,26 @@ 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,
|
||||||
|
opts opts)
|
||||||
|
:query
|
||||||
|
{
|
||||||
|
"profile",
|
||||||
|
fmt::sprintf
|
||||||
|
{
|
||||||
|
query_arg_buf, "user_id=%s%s%s",
|
||||||
|
string_view{user_id},
|
||||||
|
!empty(field)? "&field=" : "",
|
||||||
|
field
|
||||||
|
},
|
||||||
|
buf,
|
||||||
|
opts
|
||||||
|
}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
ircd::m::v1::query::query(const string_view &type,
|
ircd::m::v1::query::query(const string_view &type,
|
||||||
const string_view &args,
|
const string_view &args,
|
||||||
const mutable_buffer &buf,
|
const mutable_buffer &buf,
|
||||||
|
|
Loading…
Reference in a new issue