Skip to content

Commit 5394721

Browse files
authored
Fix policy room creation in V12 rooms. (#936)
It turns out that we got confused and thought we'd fixed policy room creation when we fixed management room creation. Even though the PR description never claimed that. In any case it looks like we were not in a very present state of mind while making the change and managed to somehow rely on string comparison for room versions... Follow up from: #924 * Fix subtle bug with management room creation. I don't really understand why I did this in the first place it was stupid. I think morbid curiosity won. * Update MPS4bot-sdk for V12 policy room creation. It turns out last time we fixed management room creation but not policy room creation... and we didn't even do that properly.
1 parent b05e24e commit 5394721

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"matrix-appservice-bridge": "^10.3.1",
6565
"matrix-bot-sdk": "npm:@vector-im/matrix-bot-sdk@^0.7.1-element.6",
6666
"matrix-protection-suite": "npm:@gnuxie/[email protected]",
67-
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@3.8.0",
67+
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@3.10.0",
6868
"pg": "^8.8.0",
6969
"yaml": "^2.3.2"
7070
},

src/appservice/AppServiceDraupnirManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export async function makeManagementRoom(
457457
);
458458
}
459459
const isV12OrAboveDefault =
460-
capabilities.ok.capabilities["m.room_versions"].default >= "12";
460+
parseInt(capabilities.ok.capabilities["m.room_versions"].default) >= 12;
461461
return await roomCreator.createRoom({
462462
preset: "private_chat",
463463
invite: [requestingUserID],

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,10 +2598,10 @@ matrix-appservice@^2.0.0:
25982598
request-promise "^4.2.6"
25992599
sanitize-html "^2.11.0"
26002600

2601-
"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@3.8.0":
2602-
version "3.8.0"
2603-
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite-for-matrix-bot-sdk/-/matrix-protection-suite-for-matrix-bot-sdk-3.8.0.tgz#d47c87154c41f81816feb740b460696f2e141820"
2604-
integrity sha512-P1YkVGVbcCKfQlPMKDY72gm9u/XJ4Hq/6NTTU2rp7/aE7erP9UiZWKn5b+gglSS2SlcIxnbSFRohNKpvGHcptA==
2601+
"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@3.10.0":
2602+
version "3.10.0"
2603+
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite-for-matrix-bot-sdk/-/matrix-protection-suite-for-matrix-bot-sdk-3.10.0.tgz#115ed98ca3634dfe32d2a98db727e2c709ff4adb"
2604+
integrity sha512-zAU/Dy3DBFgOtNWsP3ybwvVdXQjO3ro58ETn+F3BMln1WTGzTbZvvrMrL5F2ooD/uhy0XR4zjfw0Kh98/loFzw==
26052605
dependencies:
26062606
"@gnuxie/typescript-result" "^1.0.0"
26072607
await-lock "^2.2.2"

0 commit comments

Comments
 (0)