Skip to content

Commit fd7114f

Browse files
committed
Skip calling /join for rooms we arleady know we are joined to.
Gnuxie/matrix-protection-suite#61 #561
1 parent 86b7a51 commit fd7114f

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
"js-yaml": "^4.1.0",
7070
"jsdom": "^24.0.0",
7171
"matrix-appservice-bridge": "^9.0.1",
72-
"matrix-protection-suite": "npm:@gnuxie/matrix-protection-suite@1.3.0",
73-
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.3.0",
72+
"matrix-protection-suite": "npm:@gnuxie/matrix-protection-suite@1.4.0",
73+
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.4.0",
7474
"parse-duration": "^1.0.2",
7575
"pg": "^8.8.0",
7676
"shell-quote": "^1.7.3",

src/draupnirfactory/DraupnirFactory.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ export class DraupnirFactory {
3737
managementRoom: MatrixRoomID,
3838
config: IConfig
3939
): Promise<ActionResult<Draupnir>> {
40-
const roomStateManager =
41-
await this.roomStateManagerFactory.getRoomStateManager(clientUserID);
42-
const policyRoomManager =
43-
await this.roomStateManagerFactory.getPolicyRoomManager(clientUserID);
44-
const roomMembershipManager =
45-
await this.roomStateManagerFactory.getRoomMembershipManager(clientUserID);
4640
const client = await this.clientProvider(clientUserID);
4741
const clientRooms = await this.clientsInRoomMap.makeClientRooms(
4842
clientUserID,
@@ -51,6 +45,12 @@ export class DraupnirFactory {
5145
if (isError(clientRooms)) {
5246
return clientRooms;
5347
}
48+
const roomStateManager =
49+
await this.roomStateManagerFactory.getRoomStateManager(clientUserID);
50+
const policyRoomManager =
51+
await this.roomStateManagerFactory.getPolicyRoomManager(clientUserID);
52+
const roomMembershipManager =
53+
await this.roomStateManagerFactory.getRoomMembershipManager(clientUserID);
5454
const clientPlatform = this.clientCapabilityFactory.makeClientPlatform(
5555
clientUserID,
5656
client

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,17 +2526,17 @@ matrix-appservice@^2.0.0:
25262526
request-promise "^4.2.6"
25272527
sanitize-html "^2.8.0"
25282528

2529-
"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.3.0":
2530-
version "1.3.0"
2531-
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite-for-matrix-bot-sdk/-/matrix-protection-suite-for-matrix-bot-sdk-1.3.0.tgz#2efc303e9e43787e1eee7624cec9b37bfe954f4b"
2532-
integrity sha512-6tRMml+1+c4dBLqXKCWwpaESVtnDFQO6dC/AqTQCvij610bp5dQQFIdraGyKS+XNj7bm2AEJK/VAk6xQusmz+Q==
2529+
"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.4.0":
2530+
version "1.4.0"
2531+
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite-for-matrix-bot-sdk/-/matrix-protection-suite-for-matrix-bot-sdk-1.4.0.tgz#0745358810e03959344e791733e6ccb7e811689d"
2532+
integrity sha512-xGkBaBdZ3u5Z27HqG2IEPxQ8Z5slFtWCihnFzocPBtRcLDJMFXnoF1+bpWElnPomDQtw/u0gvDwSC+f4pmTqyQ==
25332533
dependencies:
25342534
"@gnuxie/typescript-result" "^1.0.0"
25352535

2536-
"matrix-protection-suite@npm:@gnuxie/matrix-protection-suite@1.3.0":
2537-
version "1.3.0"
2538-
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite/-/matrix-protection-suite-1.3.0.tgz#b6df1352b6dd62876690444ba5a8257aa9f1cb52"
2539-
integrity sha512-Gn6OeHC92PNcUQH4azN1rK12aywqcOey5dXsJEK00a7PZDseZE2EkATmhjABfptmSNTb/WRqkOi+xmdFi9bLrA==
2536+
"matrix-protection-suite@npm:@gnuxie/matrix-protection-suite@1.4.0":
2537+
version "1.4.0"
2538+
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite/-/matrix-protection-suite-1.4.0.tgz#0cce6f9dec22cf41b8ffc26861e5ae5c7cf463db"
2539+
integrity sha512-/1+L/Tf/fJx9aeNvyIfF4dqkS6YtTkRLMvSiqFNIpCq3JxOwyM2nqVBBNG5rbVPPdrxGlaFP+GuPxAUm54SdSA==
25402540
dependencies:
25412541
"@gnuxie/typescript-result" "^1.0.0"
25422542
await-lock "^2.2.2"

0 commit comments

Comments
 (0)