sanity checks

This commit is contained in:
Matthew Hodgson 2017-11-21 12:10:20 +00:00
parent 2145ee1976
commit 3ab2cfec47

View File

@ -26,6 +26,9 @@ my $group_users = [
(map { $_->{user_id} } @{decode_json($ua->get("${hs}/_matrix/client/unstable/groups/${group_id}/invited_users?access_token=${access_token}" )->decoded_content)->{chunk}}),
];
die "refusing to sync from empty room" unless (@$room_users);
die "refusing to sync to empty group" unless (@$group_users);
my $diff = {};
foreach my $user (@$room_users) { $diff->{$user}++ }
foreach my $user (@$group_users) { $diff->{$user}-- }