Skip to content

Commit

Permalink
Skip calling /join for rooms we arleady know we are joined to.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnuxie committed Sep 17, 2024
1 parent 86b7a51 commit fd7114f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"js-yaml": "^4.1.0",
"jsdom": "^24.0.0",
"matrix-appservice-bridge": "^9.0.1",
"matrix-protection-suite": "npm:@gnuxie/matrix-protection-suite@1.3.0",
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.3.0",
"matrix-protection-suite": "npm:@gnuxie/matrix-protection-suite@1.4.0",
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.4.0",
"parse-duration": "^1.0.2",
"pg": "^8.8.0",
"shell-quote": "^1.7.3",
Expand Down
12 changes: 6 additions & 6 deletions src/draupnirfactory/DraupnirFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ export class DraupnirFactory {
managementRoom: MatrixRoomID,
config: IConfig
): Promise<ActionResult<Draupnir>> {
const roomStateManager =
await this.roomStateManagerFactory.getRoomStateManager(clientUserID);
const policyRoomManager =
await this.roomStateManagerFactory.getPolicyRoomManager(clientUserID);
const roomMembershipManager =
await this.roomStateManagerFactory.getRoomMembershipManager(clientUserID);
const client = await this.clientProvider(clientUserID);
const clientRooms = await this.clientsInRoomMap.makeClientRooms(
clientUserID,
Expand All @@ -51,6 +45,12 @@ export class DraupnirFactory {
if (isError(clientRooms)) {
return clientRooms;
}
const roomStateManager =
await this.roomStateManagerFactory.getRoomStateManager(clientUserID);
const policyRoomManager =
await this.roomStateManagerFactory.getPolicyRoomManager(clientUserID);
const roomMembershipManager =
await this.roomStateManagerFactory.getRoomMembershipManager(clientUserID);
const clientPlatform = this.clientCapabilityFactory.makeClientPlatform(
clientUserID,
client
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2526,17 +2526,17 @@ matrix-appservice@^2.0.0:
request-promise "^4.2.6"
sanitize-html "^2.8.0"

"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.3.0":
version "1.3.0"
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"
integrity sha512-6tRMml+1+c4dBLqXKCWwpaESVtnDFQO6dC/AqTQCvij610bp5dQQFIdraGyKS+XNj7bm2AEJK/VAk6xQusmz+Q==
"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@1.4.0":
version "1.4.0"
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"
integrity sha512-xGkBaBdZ3u5Z27HqG2IEPxQ8Z5slFtWCihnFzocPBtRcLDJMFXnoF1+bpWElnPomDQtw/u0gvDwSC+f4pmTqyQ==
dependencies:
"@gnuxie/typescript-result" "^1.0.0"

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

0 comments on commit fd7114f

Please sign in to comment.