mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/console: Add auth events to fed head cmd.
This commit is contained in:
parent
1c4e8564b7
commit
c9e847cf58
1 changed files with 33 additions and 4 deletions
|
@ -6087,15 +6087,44 @@ console_cmd__fed__head(opt &out, const string_view &line)
|
||||||
request.in.content
|
request.in.content
|
||||||
};
|
};
|
||||||
|
|
||||||
const json::array prev_events
|
out << "DEPTH "
|
||||||
|
<< proto.get({"event", "depth"})
|
||||||
|
<< std::endl;
|
||||||
|
|
||||||
|
const json::array &prev_events
|
||||||
{
|
{
|
||||||
proto.at({"event", "prev_events"})
|
proto.get({"event", "prev_events"})
|
||||||
};
|
};
|
||||||
|
|
||||||
for(const json::array &prev_event : prev_events)
|
for(const json::array &prev_event : prev_events)
|
||||||
{
|
{
|
||||||
const string_view &id{prev_event.at(0)};
|
const m::event::id &id
|
||||||
out << id << " :" << string_view{prev_event.at(1)} << std::endl;
|
{
|
||||||
|
unquote(prev_event.at(0))
|
||||||
|
};
|
||||||
|
|
||||||
|
out << "PREV "
|
||||||
|
<< id << " "
|
||||||
|
<< string_view{prev_event.at(1)}
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
const json::array &auth_events
|
||||||
|
{
|
||||||
|
proto.get({"event", "auth_events"})
|
||||||
|
};
|
||||||
|
|
||||||
|
for(const json::array &auth_event : auth_events)
|
||||||
|
{
|
||||||
|
const m::event::id &id
|
||||||
|
{
|
||||||
|
unquote(auth_event.at(0))
|
||||||
|
};
|
||||||
|
|
||||||
|
out << "AUTH "
|
||||||
|
<< id << " "
|
||||||
|
<< string_view{auth_event.at(1)}
|
||||||
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue