mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️:fed: Prevent appending empty id parameters; minor cleanup.
This commit is contained in:
parent
5f24f10458
commit
bdf3e0a126
1 changed files with 34 additions and 8 deletions
|
@ -351,20 +351,46 @@ ircd::m::fed::frontfill::make_content(const mutable_buffer &buf,
|
|||
{
|
||||
// note: This object must be in abc order
|
||||
json::stack::object top{out};
|
||||
|
||||
// earliest
|
||||
{
|
||||
json::stack::member earliest{top, "earliest_events"};
|
||||
json::stack::array array{earliest};
|
||||
json::stack::array array
|
||||
{
|
||||
top, "earliest_events"
|
||||
};
|
||||
|
||||
for(const auto &id : pair.first)
|
||||
if(likely(id))
|
||||
array.append(id);
|
||||
}
|
||||
|
||||
// latest
|
||||
{
|
||||
json::stack::member latest{top, "latest_events"};
|
||||
json::stack::array array{latest};
|
||||
json::stack::array array
|
||||
{
|
||||
top, "latest_events"
|
||||
};
|
||||
|
||||
for(const auto &id : pair.second)
|
||||
if(likely(id))
|
||||
array.append(id);
|
||||
}
|
||||
json::stack::member{top, "limit", json::value(int64_t(opts.limit))};
|
||||
json::stack::member{top, "min_depth", json::value(int64_t(opts.min_depth))};
|
||||
|
||||
json::stack::member
|
||||
{
|
||||
top, "limit", json::value
|
||||
{
|
||||
int64_t(opts.limit)
|
||||
}
|
||||
};
|
||||
|
||||
json::stack::member
|
||||
{
|
||||
top, "min_depth", json::value
|
||||
{
|
||||
int64_t(opts.min_depth)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return out.completed();
|
||||
|
|
Loading…
Reference in a new issue