Add a developer command to reset Megolm and Olm sessions (#9044)
Useful when debugging crypto setup.pull/28788/head^2
parent
62f3a9ae05
commit
b6a50ee5a5
|
@ -1070,6 +1070,28 @@ export const Commands = [
|
||||||
category: CommandCategories.advanced,
|
category: CommandCategories.advanced,
|
||||||
renderingTypes: [TimelineRenderingType.Room],
|
renderingTypes: [TimelineRenderingType.Room],
|
||||||
}),
|
}),
|
||||||
|
new Command({
|
||||||
|
command: 'remakeolm',
|
||||||
|
description: _td('Developer command: Discards the current outbound group session and sets up new Olm sessions'),
|
||||||
|
isEnabled: () => {
|
||||||
|
return SettingsStore.getValue("developerMode");
|
||||||
|
},
|
||||||
|
runFn: (roomId) => {
|
||||||
|
try {
|
||||||
|
const room = MatrixClientPeg.get().getRoom(roomId);
|
||||||
|
|
||||||
|
MatrixClientPeg.get().forceDiscardSession(roomId);
|
||||||
|
|
||||||
|
// noinspection JSIgnoredPromiseFromCall
|
||||||
|
MatrixClientPeg.get().crypto.ensureOlmSessionsForUsers(room.getMembers().map(m => m.userId), true);
|
||||||
|
} catch (e) {
|
||||||
|
return reject(e.message);
|
||||||
|
}
|
||||||
|
return success();
|
||||||
|
},
|
||||||
|
category: CommandCategories.advanced,
|
||||||
|
renderingTypes: [TimelineRenderingType.Room],
|
||||||
|
}),
|
||||||
new Command({
|
new Command({
|
||||||
command: "rainbow",
|
command: "rainbow",
|
||||||
description: _td("Sends the given message coloured as a rainbow"),
|
description: _td("Sends the given message coloured as a rainbow"),
|
||||||
|
|
|
@ -445,6 +445,7 @@
|
||||||
"Verified key": "Verified key",
|
"Verified key": "Verified key",
|
||||||
"The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.",
|
"The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.",
|
||||||
"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",
|
"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",
|
||||||
|
"Developer command: Discards the current outbound group session and sets up new Olm sessions": "Developer command: Discards the current outbound group session and sets up new Olm sessions",
|
||||||
"Sends the given message coloured as a rainbow": "Sends the given message coloured as a rainbow",
|
"Sends the given message coloured as a rainbow": "Sends the given message coloured as a rainbow",
|
||||||
"Sends the given emote coloured as a rainbow": "Sends the given emote coloured as a rainbow",
|
"Sends the given emote coloured as a rainbow": "Sends the given emote coloured as a rainbow",
|
||||||
"Displays list of commands with usages and descriptions": "Displays list of commands with usages and descriptions",
|
"Displays list of commands with usages and descriptions": "Displays list of commands with usages and descriptions",
|
||||||
|
|
Loading…
Reference in New Issue