mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Don't save device objects to disk
Generate them from session and identity data. Save/delete pending prekey data in an in-memory store and attach it to outgoing device objects.
This commit is contained in:
@@ -198,19 +198,7 @@
|
||||
contact.fetch().always(function() {
|
||||
var sessions = contact.get('sessions') || {};
|
||||
sessions[deviceId] = record;
|
||||
contact.save({sessions: sessions}).always(function() {
|
||||
resolve(textsecure.storage.devices.getDeviceObject(encodedNumber).then(function(device) {
|
||||
if (device === undefined) {
|
||||
return textsecure.storage.axolotl.getIdentityKey(number).then(function(identityKey) {
|
||||
device = { encodedNumber: encodedNumber,
|
||||
//TODO: Remove this duplication
|
||||
identityKey: identityKey
|
||||
};
|
||||
return textsecure.storage.devices.saveDeviceObject(device);
|
||||
});
|
||||
}
|
||||
}));
|
||||
});
|
||||
contact.save({sessions: sessions}).always(resolve);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user