Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 2b186c9

Browse files
committed
Remove remakeolm slash command
1 parent d0399e7 commit 2b186c9

File tree

3 files changed

+0
-73
lines changed

3 files changed

+0
-73
lines changed

src/SlashCommands.tsx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -736,34 +736,6 @@ export const Commands = [
736736
category: CommandCategories.advanced,
737737
renderingTypes: [TimelineRenderingType.Room],
738738
}),
739-
new Command({
740-
command: "remakeolm",
741-
description: _td("slash_command|remakeolm"),
742-
isEnabled: (cli) => {
743-
return SettingsStore.getValue("developerMode") && !isCurrentLocalRoom(cli);
744-
},
745-
runFn: (cli, roomId) => {
746-
try {
747-
const room = cli.getRoom(roomId);
748-
749-
cli.forceDiscardSession(roomId);
750-
751-
return success(
752-
room?.getEncryptionTargetMembers().then((members) => {
753-
// noinspection JSIgnoredPromiseFromCall
754-
cli.crypto?.ensureOlmSessionsForUsers(
755-
members.map((m) => m.userId),
756-
true,
757-
);
758-
}),
759-
);
760-
} catch (e) {
761-
return reject(e instanceof Error ? e.message : e);
762-
}
763-
},
764-
category: CommandCategories.advanced,
765-
renderingTypes: [TimelineRenderingType.Room],
766-
}),
767739
new Command({
768740
command: "rainbow",
769741
description: _td("slash_command|rainbow"),

src/i18n/strings/en_EN.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2998,7 +2998,6 @@
29982998
"rageshake": "Send a bug report with logs",
29992999
"rainbow": "Sends the given message coloured as a rainbow",
30003000
"rainbowme": "Sends the given emote coloured as a rainbow",
3001-
"remakeolm": "Developer command: Discards the current outbound group session and sets up new Olm sessions",
30023001
"remove": "Removes user with given id from this room",
30033002
"roomavatar": "Changes the avatar of the current room",
30043003
"roomname": "Sets the room name",

test/SlashCommands-test.tsx

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -236,50 +236,6 @@ describe("SlashCommands", () => {
236236
});
237237
});
238238

239-
describe("/remakeolm", () => {
240-
beforeEach(() => {
241-
command = findCommand("remakeolm")!;
242-
});
243-
244-
describe("isEnabled", () => {
245-
describe("when developer mode is enabled", () => {
246-
beforeEach(() => {
247-
jest.spyOn(SettingsStore, "getValue").mockImplementation((settingName: string) => {
248-
if (settingName === "developerMode") return true;
249-
});
250-
});
251-
252-
it("should return true for Room", () => {
253-
setCurrentRoom();
254-
expect(command.isEnabled(client)).toBe(true);
255-
});
256-
257-
it("should return false for LocalRoom", () => {
258-
setCurrentLocalRoom();
259-
expect(command.isEnabled(client)).toBe(false);
260-
});
261-
});
262-
263-
describe("when developer mode is not enabled", () => {
264-
beforeEach(() => {
265-
jest.spyOn(SettingsStore, "getValue").mockImplementation((settingName: string) => {
266-
if (settingName === "developerMode") return false;
267-
});
268-
});
269-
270-
it("should return false for Room", () => {
271-
setCurrentRoom();
272-
expect(command.isEnabled(client)).toBe(false);
273-
});
274-
275-
it("should return false for LocalRoom", () => {
276-
setCurrentLocalRoom();
277-
expect(command.isEnabled(client)).toBe(false);
278-
});
279-
});
280-
});
281-
});
282-
283239
describe("/part", () => {
284240
it("should part room matching alias if found", async () => {
285241
const room1 = new Room("room-id", client, client.getSafeUserId());

0 commit comments

Comments
 (0)