-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94bdb1a
commit a3755c6
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Tests migrated to Complement as of https://github.com/matrix-org/complement/pull/545 | ||
# However this helper function is used in other tests. | ||
|
||
push our @EXPORT, qw( matrix_change_room_power_levels ); | ||
|
||
sub matrix_change_room_power_levels | ||
{ | ||
my ( $user, $room_id, $func ) = @_; | ||
is_User( $user ) or croak "Expected a User; got $user"; | ||
|
||
matrix_get_room_state( $user, $room_id, type => "m.room.power_levels" ) | ||
->then( sub { | ||
my ( $levels ) = @_; | ||
$func->( $levels ); | ||
|
||
matrix_put_room_state_synced( $user, $room_id, type => "m.room.power_levels", | ||
content => $levels, | ||
); | ||
}); | ||
} |