mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/client/rooms/initialsync: Add missing event_append_opts contextual data.
This commit is contained in:
parent
0def9bd5f1
commit
1f8bff0ef5
1 changed files with 19 additions and 1 deletions
|
@ -90,6 +90,16 @@ get__initialsync_local(client &client,
|
|||
const m::user &user,
|
||||
json::stack::object &out)
|
||||
{
|
||||
const m::user::room user_room
|
||||
{
|
||||
user
|
||||
};
|
||||
|
||||
const auto room_depth
|
||||
{
|
||||
m::depth(std::nothrow, room)
|
||||
};
|
||||
|
||||
char membership_buf[m::MEMBERSHIP_MAX_SIZE];
|
||||
json::stack::member
|
||||
{
|
||||
|
@ -179,7 +189,7 @@ get__initialsync_local(client &client,
|
|||
};
|
||||
|
||||
const m::room::state room_state{room};
|
||||
room_state.for_each(m::event::id::closure_bool{[&state, &room, &user]
|
||||
room_state.for_each(m::event::id::closure_bool{[&]
|
||||
(const m::event::id &event_id)
|
||||
{
|
||||
if(!visible(event_id, user.user_id))
|
||||
|
@ -195,6 +205,10 @@ get__initialsync_local(client &client,
|
|||
|
||||
m::event_append_opts opts;
|
||||
opts.event_idx = &event.event_idx;
|
||||
opts.user_id = &user.user_id;
|
||||
opts.user_room = &user_room;
|
||||
opts.room_depth = &room_depth;
|
||||
opts.query_txnid = false;
|
||||
m::append(state, event, opts);
|
||||
return true;
|
||||
}});
|
||||
|
@ -236,6 +250,10 @@ get__initialsync_local(client &client,
|
|||
|
||||
m::event_append_opts opts;
|
||||
opts.event_idx = &event_idx;
|
||||
opts.user_id = &user.user_id;
|
||||
opts.user_room = &user_room;
|
||||
opts.room_depth = &room_depth;
|
||||
opts.query_txnid = true;
|
||||
m::append(chunk, event, opts);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue