Skip to content

Commit

Permalink
Use new API as per matrix-org/synapse#3045
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebarnard1 committed Apr 5, 2018
1 parent 5dc01b6 commit 1caa91b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/53groups/12joinable.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
->then( sub {
( $group_id ) = @_;

matrix_set_group_joinable( $group_id, $creator, 1 );
matrix_set_group_join_policy( $group_id, $creator, "open" );
})->then( sub {
matrix_get_group_summary( $creator, $group_id );
})->then( sub {
Expand All @@ -19,9 +19,9 @@
log_if_fail "Summary Body", $body;

assert_json_keys( $body, qw( profile ) );
assert_eq( $body->{profile}->{is_joinable}, JSON::true );
assert_eq( $body->{profile}->{join_policy}, "open" );

matrix_set_group_joinable( $group_id, $creator, 0 );
matrix_set_group_join_policy( $group_id, $creator, "invite" );
})->then( sub {
matrix_get_group_summary( $creator, $group_id );
})->then( sub {
Expand All @@ -30,7 +30,7 @@
log_if_fail "Summary Body", $body;

assert_json_keys( $body, qw( profile ) );
assert_eq( $body->{profile}->{is_joinable}, JSON::false );
assert_eq( $body->{profile}->{join_policy}, "invite" );

Future->done( 1 );
});
Expand All @@ -48,7 +48,7 @@
->then( sub {
( $group_id ) = @_;

matrix_set_group_joinable( $group_id, $creator, 1 );
matrix_set_group_join_policy( $group_id, $creator, "open" );
})->then( sub {
matrix_join_group( $group_id, $user );
})->then( sub {
Expand Down Expand Up @@ -93,7 +93,7 @@
->then( sub {
( $group_id ) = @_;

matrix_set_group_joinable( $group_id, $creator, 1 );
matrix_set_group_join_policy( $group_id, $creator, "open" );
})->then( sub {
matrix_join_group( $group_id, $user );
})->then( sub {
Expand All @@ -110,15 +110,15 @@
});
};

sub matrix_set_group_joinable
sub matrix_set_group_join_policy
{
my ( $group_id, $user, $joinable ) = @_;
my ( $group_id, $user, $join_policy ) = @_;

do_request_json_for( $user,
method => "PUT",
uri => "/r0/groups/$group_id/joinable",
uri => "/r0/groups/$group_id/settings/m.join_policy",
content => {
joinable => $joinable ? JSON::true : JSON::false,
join_policy => $join_policy,
},
);
}

0 comments on commit 1caa91b

Please sign in to comment.