Merge branch 'soru/properly-handle-changes-x-signing-key' into 'main'
fix: properly handle changed cross-signing keys Closes #128 See merge request famedly/famedlysdk!592
This commit is contained in:
		
						commit
						af0c402717
					
				|  | @ -1508,6 +1508,11 @@ sort order of ${prevState.sortOrder}. This should never happen...'''); | ||||||
|               if (!oldEntry.value.usage.contains(keyType)) { |               if (!oldEntry.value.usage.contains(keyType)) { | ||||||
|                 _userDeviceKeys[userId].crossSigningKeys[oldEntry.key] = |                 _userDeviceKeys[userId].crossSigningKeys[oldEntry.key] = | ||||||
|                     oldEntry.value; |                     oldEntry.value; | ||||||
|  |               } else if (database != null) { | ||||||
|  |                 // There is a previous cross-signing key with  this usage, that we no | ||||||
|  |                 // longer need/use. Clear it from the database. | ||||||
|  |                 dbActions.add(() => database.removeUserCrossSigningKey( | ||||||
|  |                     id, userId, oldEntry.key)); | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|             final entry = CrossSigningKey.fromMatrixCrossSigningKey( |             final entry = CrossSigningKey.fromMatrixCrossSigningKey( | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue