mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
modules/console: Allow empty event_id to indicate the present state.
This commit is contained in:
parent
289f9faf4a
commit
499c6f4f21
1 changed files with 11 additions and 3 deletions
|
@ -38,8 +38,16 @@ _visible_(const m::event &event,
|
|||
return membership == "invite";
|
||||
|
||||
assert(history_visibility == "shared");
|
||||
const m::room present{room.room_id};
|
||||
return present.membership(user_id, "join");
|
||||
|
||||
// If the room is not at the present event then we have to run another
|
||||
// test for membership here. Otherwise the "join" test already failed.
|
||||
if(room.event_id)
|
||||
{
|
||||
const m::room present{room.room_id};
|
||||
return present.membership(user_id, "join");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -85,7 +93,7 @@ visible(const m::event &event,
|
|||
{
|
||||
const m::room room
|
||||
{
|
||||
at<"room_id"_>(event), at<"event_id"_>(event)
|
||||
at<"room_id"_>(event), json::get<"event_id"_>(event)
|
||||
};
|
||||
|
||||
static const m::event::fetch::opts fopts
|
||||
|
|
Loading…
Reference in a new issue