mirror of
https://github.com/matrix-construct/construct
synced 2025-01-05 20:34:29 +01:00
ircd:Ⓜ️:event::append: Support replaces_state in unsigned object.
This commit is contained in:
parent
91fafda7bb
commit
53ff7e229b
1 changed files with 17 additions and 0 deletions
|
@ -331,6 +331,7 @@ ircd::m::event::append::append(json::stack::object &object,
|
|||
});
|
||||
|
||||
if(prev_state_idx)
|
||||
{
|
||||
m::get(std::nothrow, prev_state_idx, "content", [&unsigned_]
|
||||
(const json::object &content)
|
||||
{
|
||||
|
@ -340,6 +341,22 @@ ircd::m::event::append::append(json::stack::object &object,
|
|||
};
|
||||
});
|
||||
|
||||
const auto replaces_state_id
|
||||
{
|
||||
m::event_id(std::nothrow, prev_state_idx)
|
||||
};
|
||||
|
||||
json::stack::member
|
||||
{
|
||||
unsigned_, "replaces_state", json::value
|
||||
{
|
||||
replaces_state_id?
|
||||
string_view{replaces_state_id}:
|
||||
string_view{}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if(unlikely(event_append_info))
|
||||
log::info
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue