File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -893,7 +893,6 @@ export class MessageRepository {
893893 try {
894894 // We delete the stored session so that it can be recreated later on
895895 const session_id = await this . cryptography_repository . deleteSession ( userId , client_id ) ;
896- this . core . service ! . cryptography . cryptobox . session_delete ( session_id ) ;
897896 if ( session_id ) {
898897 this . logger . info ( `Deleted session with client '${ client_id } ' of user '${ userId . id } '.` ) ;
899898 } else {
Original file line number Diff line number Diff line change @@ -231,6 +231,7 @@ export class CryptographyRepository {
231231
232232 deleteSession ( userId : QualifiedId , clientId : string ) : Promise < string > {
233233 const sessionId = constructClientPrimaryKey ( userId , clientId ) ;
234+ this . core . service ! . cryptography . cryptobox . session_delete ( sessionId ) ;
234235 return this . cryptobox . session_delete ( sessionId ) ;
235236 }
236237
@@ -460,7 +461,9 @@ export class CryptographyRepository {
460461 const cipherText = cipherTextArray . buffer ;
461462 const sessionId = constructClientPrimaryKey ( userId , eventData . sender ) ;
462463
463- const plaintext = await this . cryptobox . decrypt ( sessionId , cipherText ) ;
464+ const plaintext = isFederatedEnv
465+ ? await this . core . service . cryptography . cryptobox . decrypt ( sessionId , cipherText )
466+ : await this . cryptobox . decrypt ( sessionId , cipherText ) ;
464467 return GenericMessage . decode ( plaintext ) ;
465468 }
466469
You can’t perform that action at this time.
0 commit comments