mirror of
				https://github.com/vector-im/element-web.git
				synced 2025-11-04 02:02:14 +01:00 
			
		
		
		
	Merge pull request #2140 from matrix-org/dbkr/discardsession
Slash command to discard megolm session
This commit is contained in:
		
						commit
						d9fb88246a
					
				@ -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",
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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.",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user