diff --git a/app/js/lib/mtproto.js b/app/js/lib/mtproto.js index 35815532..cc588b78 100644 --- a/app/js/lib/mtproto.js +++ b/app/js/lib/mtproto.js @@ -30,8 +30,6 @@ angular.module('izhukov.mtproto', ['izhukov.utils']) {id: 5, url: 'http://149.154.171.5'} ]); - var sslSubdomains = 'pluto,venus,aurora,vesta,flora'; - var chosenServers = {}; function chooseServer(dcID) { diff --git a/app/js/lib/tl_utils.js b/app/js/lib/tl_utils.js index 3c92adb0..5b6ed2b4 100644 --- a/app/js/lib/tl_utils.js +++ b/app/js/lib/tl_utils.js @@ -148,6 +148,9 @@ TLSerialization.prototype.storeString = function (s, field) { TLSerialization.prototype.storeBytes = function (bytes, field) { + if (bytes instanceof ArrayBuffer) { + bytes = new Uint8Array(bytes); + } this.debug && console.log('>>>', bytesToHex(bytes), (field || '') + ':bytes'); var len = bytes.byteLength || bytes.length; @@ -160,6 +163,7 @@ TLSerialization.prototype.storeBytes = function (bytes, field) { this.byteView[this.offset++] = (len & 0xFF00) >> 8; this.byteView[this.offset++] = (len & 0xFF0000) >> 16; } + this.byteView.set(bytes, this.offset); this.offset += len;