mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 08:24:08 +01:00
modules/console: Sort fed event_auth output by depth.
This commit is contained in:
parent
9df6d127af
commit
130c4970b6
1 changed files with 10 additions and 2 deletions
|
@ -2691,8 +2691,16 @@ console_cmd__fed__event_auth(opt &out, const string_view &line)
|
|||
request
|
||||
};
|
||||
|
||||
for(const json::object &event : auth_chain)
|
||||
out << pretty_oneline(m::event{event}) << std::endl;
|
||||
std::vector<m::event> events(size(auth_chain));
|
||||
std::transform(begin(auth_chain), end(auth_chain), begin(events), []
|
||||
(const json::object &event) -> m::event
|
||||
{
|
||||
return event;
|
||||
});
|
||||
|
||||
std::sort(begin(events), end(events));
|
||||
for(const auto &event : events)
|
||||
out << pretty_oneline(event) << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue