Skip to content

Commit 6fb22af

Browse files
authored
Update for MPS v2.3.0 (#655)
* Update ServerACLConsequencesRenderer for updated interface. Fixes #450. * Update for MPS v2.3.0. https://github.com/Gnuxie/matrix-protection-suite/releases/tag/v2.3.0
1 parent 5d11114 commit 6fb22af

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
"jsdom": "^24.0.0",
7171
"matrix-appservice-bridge": "^10.3.1",
7272
"matrix-bot-sdk": "npm:@vector-im/matrix-bot-sdk@^0.7.1-element.6",
73-
"matrix-protection-suite": "npm:@gnuxie/matrix-protection-suite@2.2.0",
74-
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@2.2.0",
73+
"matrix-protection-suite": "npm:@gnuxie/matrix-protection-suite@2.3.0",
74+
"matrix-protection-suite-for-matrix-bot-sdk": "npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@2.3.0",
7575
"parse-duration": "^1.0.2",
7676
"pg": "^8.8.0",
7777
"shell-quote": "^1.7.3",

src/capabilities/ServerACLConsequencesRenderer.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ActionResult,
1313
Capability,
1414
DescriptionMeta,
15-
Ok,
1615
PolicyListRevision,
1716
RoomSetResult,
1817
ServerACLConsequencesContext,
@@ -49,7 +48,7 @@ class StandardServerConsequencesRenderer implements ServerConsequences {
4948
public async consequenceForServersInRoom(
5049
roomID: StringRoomID,
5150
revision: PolicyListRevision
52-
): Promise<ActionResult<void>> {
51+
): Promise<ActionResult<boolean>> {
5352
const capabilityResult = await this.capability.consequenceForServersInRoom(
5453
roomID,
5554
revision
@@ -71,8 +70,11 @@ class StandardServerConsequencesRenderer implements ServerConsequences {
7170
);
7271
return capabilityResult;
7372
}
74-
this.messageCollector.addOneliner(this.description, title);
75-
return Ok(undefined);
73+
// only add the message if we changed anything in the room.
74+
if (capabilityResult.ok) {
75+
this.messageCollector.addOneliner(this.description, title);
76+
}
77+
return capabilityResult;
7678
}
7779
public async consequenceForServersInRoomSet(
7880
revision: PolicyListRevision

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,17 +2645,17 @@ matrix-appservice@^2.0.0:
26452645
request-promise "^4.2.6"
26462646
sanitize-html "^2.11.0"
26472647

2648-
"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@2.2.0":
2649-
version "2.2.0"
2650-
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite-for-matrix-bot-sdk/-/matrix-protection-suite-for-matrix-bot-sdk-2.2.0.tgz#bbcb290097430a2ba6c387bf40002517b38f0776"
2651-
integrity sha512-uMTWBYqz61ZjLDWyYpMNcyHPko0eLKOgkNhOIFhih7I6gMpHCuqq6rQz43r25oNP1oR3YbcuwyXLFFV0h3cgnA==
2648+
"matrix-protection-suite-for-matrix-bot-sdk@npm:@gnuxie/matrix-protection-suite-for-matrix-bot-sdk@2.3.0":
2649+
version "2.3.0"
2650+
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite-for-matrix-bot-sdk/-/matrix-protection-suite-for-matrix-bot-sdk-2.3.0.tgz#fbc20d00809c7bdd242bf8c7962500e38f483952"
2651+
integrity sha512-vttnVVXykN4SF2XGGpTWcxTOWUumcLjQs9NJSoqKe5YttmzQNhY6IwCTybk2pIsajZbt8MusBCfxeCYB6NbISA==
26522652
dependencies:
26532653
"@gnuxie/typescript-result" "^1.0.0"
26542654

2655-
"matrix-protection-suite@npm:@gnuxie/matrix-protection-suite@2.2.0":
2656-
version "2.2.0"
2657-
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite/-/matrix-protection-suite-2.2.0.tgz#53aaa11159abcc5f79225b47da36dff0110e1ffb"
2658-
integrity sha512-w7a61RUeMcRBaXJF86g6W/hxycJ7o5thEm1SKkgoErrh4bWEivXL6zXn057j7I/hsvXolgXMsAIXpkHFajzjsQ==
2655+
"matrix-protection-suite@npm:@gnuxie/matrix-protection-suite@2.3.0":
2656+
version "2.3.0"
2657+
resolved "https://registry.yarnpkg.com/@gnuxie/matrix-protection-suite/-/matrix-protection-suite-2.3.0.tgz#1a7346f1ed26f7e6459001ac0ff025ca11ab66d9"
2658+
integrity sha512-YpBrQxRiFg0DVd/ru16W7pcqHH7sZv7r+JFUn5ZIL8Ya0Vt+MpWo22ZFkU0WGf5+I1KfgYLzV/C2nBisS4ZskA==
26592659
dependencies:
26602660
"@gnuxie/typescript-result" "^1.0.0"
26612661
await-lock "^2.2.2"

0 commit comments

Comments
 (0)