mirror of
https://github.com/matrix-construct/construct
synced 2024-11-19 00:10:59 +01:00
modules/federation/user_keys_query: Add the unsigned.device_display_name to response.
This commit is contained in:
parent
16e83bbcca
commit
7c69752114
1 changed files with 24 additions and 4 deletions
|
@ -25,7 +25,7 @@ user_keys_query_resource
|
|||
}
|
||||
};
|
||||
|
||||
static bool
|
||||
static void
|
||||
_query_user_device(client &client,
|
||||
const resource::request &request,
|
||||
const m::user::id &user_id,
|
||||
|
@ -94,19 +94,39 @@ post__user_keys_query(client &client,
|
|||
return response;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
_query_user_device(client &client,
|
||||
const resource::request &request,
|
||||
const m::user::id &user_id,
|
||||
const string_view &device_id,
|
||||
json::stack::object &out)
|
||||
{
|
||||
return m::device::get(std::nothrow, user_id, device_id, "keys", [&device_id, &out]
|
||||
json::stack::object object
|
||||
{
|
||||
out, device_id
|
||||
};
|
||||
|
||||
m::device::get(std::nothrow, user_id, device_id, "keys", [&device_id, &object]
|
||||
(const json::object &device_keys)
|
||||
{
|
||||
for(const auto &member : device_keys)
|
||||
json::stack::member
|
||||
{
|
||||
out, device_id, device_keys
|
||||
object, member.first, member.second
|
||||
};
|
||||
});
|
||||
|
||||
m::device::get(std::nothrow, user_id, device_id, "display_name", [&device_id, &object]
|
||||
(const string_view &display_name)
|
||||
{
|
||||
json::stack::object non_hancock
|
||||
{
|
||||
object, "unsigned"
|
||||
};
|
||||
|
||||
json::stack::member
|
||||
{
|
||||
non_hancock, "device_display_name", display_name
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue