Passive UUID support
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
f64ca0ed21
commit
a90246cbe5
49 changed files with 2226 additions and 776 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue