Replace load/decode/index around our own number with helpers

This commit is contained in:
Matt Corallo 2015-03-24 15:48:59 -07:00 committed by lilia
parent 3759fe46e9
commit 454b4726bd
12 changed files with 120 additions and 41 deletions

View file

@ -95,7 +95,7 @@ window.textsecure.api = function () {
}
if (param.do_auth) {
param.user = textsecure.storage.getUnencrypted("number_id");
param.user = textsecure.storage.user.getNumber() + "." + textsecure.storage.user.getDeviceId();
param.password = textsecure.storage.getEncrypted("password");
}
@ -321,7 +321,7 @@ window.textsecure.api = function () {
var URL = URL_BASE.replace(/^http/g, 'ws') + url + '/?';
var params = '';
if (auth) {
var user = textsecure.storage.getUnencrypted("number_id");
var user = textsecure.storage.user.getNumber() + "." + textsecure.storage.user.getDeviceId();
var password = textsecure.storage.getEncrypted("password");
var params = 'login=%2B' + encodeURIComponent(user.substring(1)) + '&password=' + encodeURIComponent(password);
}