From 63938a3f9f4799fe656ca250d2342ebe83f718e5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 29 Aug 2018 18:09:37 +0100 Subject: [PATCH] Slash command to discard megolm session For faster crypto debugging Requires https://github.com/matrix-org/matrix-js-sdk/pull/704 --- src/SlashCommands.js | 15 +++++++++++++++ src/i18n/strings/en_EN.json | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/SlashCommands.js b/src/SlashCommands.js index 9c9573ae21..3a8e77293b 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -470,6 +471,19 @@ export const CommandMap = { description: _td('Displays action'), hideCompletionAfterSpace: true, }), + + discardsession: new Command({ + name: 'discardsession', + description: _td('Forces the current outbound group session in an encrypted room to be discarded'), + runFn: function(roomId) { + try { + MatrixClientPeg.get().forceDiscardSession(roomId); + } catch (e) { + return reject(e.message); + } + return success(); + }, + }), }; /* eslint-enable babel/no-invalid-this */ @@ -477,6 +491,7 @@ export const CommandMap = { // helpful aliases const aliases = { j: "join", + newballsplease: "discardsession", }; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 2371ba0ca6..643bf06089 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -145,6 +145,8 @@ "Verified key": "Verified key", "The signing key you provided matches the signing key you received from %(userId)s's device %(deviceId)s. Device marked as verified.": "The signing key you provided matches the signing key you received from %(userId)s's device %(deviceId)s. Device marked as verified.", "Displays action": "Displays action", + "Forces the current outbound group session in an encrypted room to be discarded": "Forces the current outbound group session in an encrypted room to be discarded", + "Error Discarding Session": "Error Discarding Session", "Unrecognised command:": "Unrecognised command:", "Reason": "Reason", "%(targetName)s accepted the invitation for %(displayName)s.": "%(targetName)s accepted the invitation for %(displayName)s.",