mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Do not rely on deviceObject.sessions anywhere in sendmessage
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
return undefined;
|
||||
return device.sessions;
|
||||
},
|
||||
|
||||
putSessionsForDevice: function(encodedNumber, sessions) {
|
||||
var device = textsecure.storage.devices.getDeviceObject(encodedNumber);
|
||||
if (device === undefined) {
|
||||
@@ -43,6 +44,13 @@
|
||||
device.sessions = sessions;
|
||||
return textsecure.storage.devices.saveDeviceObject(device);
|
||||
},
|
||||
|
||||
haveOpenSessionForDevice: function(encodedNumber) {
|
||||
var sessions = textsecure.storage.sessions.getSessionsForNumber(encodedNumber);
|
||||
if (sessions === undefined || !sessions.haveOpenSession())
|
||||
return false;
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
window.textsecure.storage.devices = {
|
||||
|
||||
Reference in New Issue
Block a user