mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-27 01:53:13 +01:00
Write identity key into 'account' object.
This is the beginning of a migration to storing one identity key per account, instead of the braindead duplication we're doing now. Part one of a two-part deployment in the schema migration process.
This commit is contained in:
@@ -70,7 +70,14 @@ public class KeysController {
|
||||
@PUT
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public void setKeys(@Auth Account account, @Valid PreKeyList preKeys) {
|
||||
Device device = account.getAuthenticatedDevice().get();
|
||||
Device device = account.getAuthenticatedDevice().get();
|
||||
String identityKey = preKeys.getLastResortKey().getIdentityKey();
|
||||
|
||||
if (!identityKey.equals(account.getIdentityKey())) {
|
||||
account.setIdentityKey(identityKey);
|
||||
accounts.update(account);
|
||||
}
|
||||
|
||||
keys.store(account.getNumber(), device.getId(), preKeys.getKeys(), preKeys.getLastResortKey());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user