Skip to content

Commit

Permalink
Merge pull request #135 from matrix-org/markjh/joined_guest_access
Browse files Browse the repository at this point in the history
Guest users must be joined to a room to see it in /sync
  • Loading branch information
NegativeMjark committed Jan 6, 2016
2 parents 938650b + 7c6becc commit 0d6035d
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions tests/30rooms/60anonymousaccess.pl
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,6 @@
})->followed_by( \&expect_4xx_or_empty_chunk );
};

test "Anonymous user cannot call /sync on non-world_readable room",
requires => [ anonymous_user_fixture(), local_user_fixture() ],

do => sub {
my ( $anonymous_user, $user ) = @_;

my $room_id;

matrix_create_and_join_room( [ $user ] )
->then( sub {
( $room_id ) = @_;

matrix_send_room_text_message( $user, $room_id, body => "mice" )
})->then( sub {
matrix_sync( $anonymous_user, filter => encode_json( {
room => { rooms => [ $room_id ] }
}))->main::expect_http_403;
});
};

sub await_event_not_presence_for
{
my ( $user, $room_id, $allowed_users ) = @_;
Expand Down Expand Up @@ -224,11 +204,16 @@ sub await_event_not_presence_for
( $room_id ) = @_;

matrix_set_room_history_visibility( $user, $room_id, "world_readable" );
})->then( sub {
matrix_set_room_guest_access( $user, $room_id, "can_join" );
})->then( sub {
matrix_send_room_text_message( $user, $room_id, body => "mice" );
})->then( sub {
( $sent_event_id ) = @_;

matrix_join_room( $anonymous_user, $room_id );
})->then( sub {

matrix_sync( $anonymous_user, filter => encode_json({
room => {
rooms => [ $room_id ],
Expand Down

0 comments on commit 0d6035d

Please sign in to comment.