mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/key/keys: Fix cache query for empty key_id: find latest key.
This commit is contained in:
parent
7854dc51c1
commit
8146b730e2
1 changed files with 10 additions and 0 deletions
|
@ -238,6 +238,16 @@ cache_get(const string_view &server_name,
|
|||
node_id
|
||||
};
|
||||
|
||||
// Without a key_id we search for the most recent key; note this is not
|
||||
// the same as making a state_key="" query, as that would be an actual
|
||||
// ircd.key entry without an id (which shouldn't exist).
|
||||
if(!key_id)
|
||||
return node_room.get(std::nothrow, "ircd.key", [&closure]
|
||||
(const m::event &event)
|
||||
{
|
||||
closure(json::get<"content"_>(event));
|
||||
});
|
||||
|
||||
return node_room.get(std::nothrow, "ircd.key", key_id, [&closure]
|
||||
(const m::event &event)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue