Skip to content

Commit

Permalink
modules/federation/invite: Workaround matrix-org/synapse@c06b2b7142 m…
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Jan 14, 2023
1 parent 81169ab commit d5c0e60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion modules/client/sync/rooms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,15 @@ ircd::m::sync::rooms_linear(data &data)
&& membership == "join"
};

const bool is_own_positive
{
is_own_membership
&& (membership == "join" || membership == "invite")
};

//assert(!is_own_join || m::membership(*data.event) == "join");
assert(!is_own_join || !!m::membership(membuf, room, data.user));
assert(is_own_join || !json::get<"room_id"_>(*data.event) || m::exists(room));
assert(is_own_positive || !json::get<"room_id"_>(*data.event) || m::exists(room));

if(should_ignore(data))
return false;
Expand Down
5 changes: 4 additions & 1 deletion modules/federation/invite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,10 @@ try
vmopts.node_id = request.node_id;

// Synapse may 403 a fetch of the prev_event of the invite event.
vmopts.phase.set(m::vm::phase::FETCH_PREV, false);
vmopts.fetch = false;

// Synapse now 403's a fetch of auth_events of the invite event
vmopts.auth = false;

// Don't throw an exception for a re-evaluation; this will just be a no-op
vmopts.nothrows |= m::vm::fault::EXISTS;
Expand Down

0 comments on commit d5c0e60

Please sign in to comment.