Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that exchanged 3PID invites have correct room state #624

Merged
merged 1 commit into from
Jun 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/30rooms/12thirdpartyinvite.pl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,26 @@ sub can_invite_unbound_3pid
->then( sub {
$id_server->bind_identity( $hs_uribase, "email", $invitee_email, $invitee );
})->then( sub {
await_sync( $invitee, check => sub {
my ( $body ) = @_;

return 0 unless exists $body->{rooms}{invite}{$room_id};

return $body->{rooms}{invite}{$room_id};
})
})->then( sub {
my ( $body ) = @_;

log_if_fail "Invite", $body;

assert_json_list( $body->{invite_state}{events} );

my %members = map {
$_->{state_key} => $_
} grep { $_->{type} eq "m.room.member" } @{ $body->{invite_state}{events} };

exists $members{ $inviter->user_id } or die "No inviter member invite state";

matrix_get_room_state( $inviter, $room_id,
type => "m.room.member",
state_key => $invitee->user_id,
Expand Down