mirror of
https://github.com/matrix-construct/construct
synced 2025-01-21 20:11:59 +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)
|
if(prev_state_idx)
|
||||||
|
{
|
||||||
m::get(std::nothrow, prev_state_idx, "content", [&unsigned_]
|
m::get(std::nothrow, prev_state_idx, "content", [&unsigned_]
|
||||||
(const json::object &content)
|
(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))
|
if(unlikely(event_append_info))
|
||||||
log::info
|
log::info
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue