From 77e4515b3dd99ed7dfa69233033e0fc5fca51520 Mon Sep 17 00:00:00 2001 From: lub Date: Sun, 24 Nov 2019 12:06:35 +0100 Subject: [PATCH] simplify invite handling this also fixes a bug where the bot only joined invite-only rooms whoops --- bot.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bot.ps1 b/bot.ps1 index af435f4..dd36eaf 100755 --- a/bot.ps1 +++ b/bot.ps1 @@ -327,10 +327,7 @@ function Invoke-MatrixSync { #.PSObject.Properties because the rooms under .invite are [NoteProperty] $room_ids = $response.rooms.invite.PSObject.Properties.Name foreach($room_id in $room_ids) { - $invites = $response.rooms.invite.$room_id.invite_state.events | Where-Object {$_.content.join_rule -eq 'invite'} - foreach($invite in $invites) { - Join-MatrixRoom -RoomId $room_id - } + Join-MatrixRoom -RoomId $room_id } return $response.next_batch