From 542affc6711a449db5d8d55e6ad6ff6ee0abbe2c Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 30 Oct 2014 10:36:41 +0300 Subject: [PATCH] Fixed file send --- app/js/lib/mtproto.js | 2 -- app/js/lib/tl_utils.js | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) 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;