mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Passive UUID support
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
committed by
Scott Nonnenberg
parent
f64ca0ed21
commit
a90246cbe5
@@ -16,13 +16,33 @@
|
||||
}
|
||||
},
|
||||
|
||||
setUuidAndDeviceId(uuid, deviceId) {
|
||||
textsecure.storage.put('uuid_id', `${uuid}.${deviceId}`);
|
||||
},
|
||||
|
||||
getNumber() {
|
||||
const numberId = textsecure.storage.get('number_id');
|
||||
if (numberId === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(numberId)[0];
|
||||
},
|
||||
|
||||
getUuid() {
|
||||
const uuid = textsecure.storage.get('uuid_id');
|
||||
if (uuid === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(uuid)[0];
|
||||
},
|
||||
|
||||
getDeviceId() {
|
||||
return this._getDeviceIdFromUuid() || this._getDeviceIdFromNumber();
|
||||
},
|
||||
|
||||
_getDeviceIdFromUuid() {
|
||||
const uuid = textsecure.storage.get('uuid_id');
|
||||
if (uuid === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(uuid)[1];
|
||||
},
|
||||
|
||||
_getDeviceIdFromNumber() {
|
||||
const numberId = textsecure.storage.get('number_id');
|
||||
if (numberId === undefined) return undefined;
|
||||
return textsecure.utils.unencodeNumber(numberId)[1];
|
||||
|
||||
Reference in New Issue
Block a user