Add support for device name
This commit is contained in:
parent
9f1af24b9c
commit
f32ff58953
6 changed files with 71 additions and 31 deletions
|
@ -24,8 +24,11 @@
|
|||
window.textsecure.storage = window.textsecure.storage || {};
|
||||
|
||||
window.textsecure.storage.user = {
|
||||
setNumberAndDeviceId: function(number, deviceId) {
|
||||
setNumberAndDeviceId: function(number, deviceId, deviceName) {
|
||||
textsecure.storage.put("number_id", number + "." + deviceId);
|
||||
if (deviceName) {
|
||||
textsecure.storage.put("device_name", deviceName);
|
||||
}
|
||||
},
|
||||
|
||||
getNumber: function(key, defaultValue) {
|
||||
|
@ -40,6 +43,10 @@
|
|||
if (number_id === undefined)
|
||||
return undefined;
|
||||
return textsecure.utils.unencodeNumber(number_id)[1];
|
||||
},
|
||||
|
||||
getDeviceName: function(key) {
|
||||
return textsecure.storage.get("device_name");
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue