Encrypt device name on account create, on first launch if needed
This commit is contained in:
@@ -325,6 +325,7 @@ function HTTPError(message, providedCode, response, stack) {
|
||||
|
||||
const URL_CALLS = {
|
||||
accounts: 'v1/accounts',
|
||||
updateDeviceName: 'v1/accounts/name',
|
||||
attachment: 'v1/attachments',
|
||||
deliveryCert: 'v1/certificate/delivery',
|
||||
supportUnauthenticatedDelivery: 'v1/devices/unauthenticated_delivery',
|
||||
@@ -386,6 +387,7 @@ function initialize({ url, cdnUrl, certificateAuthority, proxyUrl }) {
|
||||
sendMessages,
|
||||
sendMessagesUnauth,
|
||||
setSignedPreKey,
|
||||
updateDeviceName,
|
||||
};
|
||||
|
||||
function _ajax(param) {
|
||||
@@ -568,6 +570,16 @@ function initialize({ url, cdnUrl, certificateAuthority, proxyUrl }) {
|
||||
return response;
|
||||
}
|
||||
|
||||
function updateDeviceName(deviceName) {
|
||||
return _ajax({
|
||||
call: 'updateDeviceName',
|
||||
httpType: 'PUT',
|
||||
jsonData: {
|
||||
deviceName,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function getDevices() {
|
||||
return _ajax({
|
||||
call: 'devices',
|
||||
|
Reference in New Issue
Block a user