Skip to content

Commit

Permalink
Do not reset device keys if migrating to CryptoSDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderas committed Feb 13, 2023
1 parent 062789d commit ef4044f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Riot/Modules/MatrixKit/Models/Account/MXKAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -947,9 +947,10 @@ - (void)closeSession:(BOOL)clearStore

if (clearStore)
{
// Force a reload of device keys at the next session start.
// Force a reload of device keys at the next session start, unless we are just about to migrate
// all data and device keys into CryptoSDK.
// This will fix potential UISIs other peoples receive for our messages.
if ([mxSession.crypto isKindOfClass:[MXLegacyCrypto class]])
if ([mxSession.crypto isKindOfClass:[MXLegacyCrypto class]] && !MXSDKOptions.sharedInstance.enableCryptoSDK)
{
[(MXLegacyCrypto *)mxSession.crypto resetDeviceKeys];
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-7369.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not reset device keys if migrating to CryptoSDK

0 comments on commit ef4044f

Please sign in to comment.