diff --git a/css/app.css b/css/app.css index 4466a3a2..48c621b8 100644 --- a/css/app.css +++ b/css/app.css @@ -1550,6 +1550,8 @@ img.img_fullsize { box-shadow: none; -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + + -webkit-user-select: text; } .emoji-wysiwyg-editor img { width: 20px; diff --git a/js/app.js b/js/app.js index 9e571246..41dba584 100644 --- a/js/app.js +++ b/js/app.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/background.js b/js/background.js index eb26fb96..64a42b82 100644 --- a/js/background.js +++ b/js/background.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/controllers.js b/js/controllers.js index c0aaa764..a9bc74bc 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -505,6 +505,7 @@ angular.module('myApp.controllers', []) $scope.missedCount = 0; } $scope.mediaType = mediaType || false; + $scope.history = []; loadHistory(); } @@ -719,19 +720,23 @@ angular.module('myApp.controllers', []) NotificationsManager.getPeerMuted($scope.userID).then(function (muted) { $scope.settings.notifications = !muted; - }); - $scope.$watch('settings.notifications', function(newValue) { - NotificationsManager.getPeerSettings($scope.userID).then(function (settings) { - if (newValue) { - settings.mute_until = 0; - } else { - settings.mute_until = 2000000000; + $scope.$watch('settings.notifications', function(newValue, oldValue) { + if (newValue === oldValue) { + return false; } - NotificationsManager.savePeerSettings($scope.userID, settings); + NotificationsManager.getPeerSettings($scope.userID).then(function (settings) { + if (newValue) { + settings.mute_until = 0; + } else { + settings.mute_until = 2000000000; + } + NotificationsManager.savePeerSettings($scope.userID, settings); + }); }); }); + $scope.goToHistory = function () { $rootScope.$broadcast('history_focus', {peerString: $scope.user.peerString}); }; @@ -763,19 +768,23 @@ angular.module('myApp.controllers', []) NotificationsManager.getPeerMuted(-$scope.chatID).then(function (muted) { $scope.settings.notifications = !muted; - }); - $scope.$watch('settings.notifications', function(newValue) { - NotificationsManager.getPeerSettings(-$scope.chatID).then(function (settings) { - if (newValue) { - settings.mute_until = 0; - } else { - settings.mute_until = 2000000000; + $scope.$watch('settings.notifications', function(newValue, oldValue) { + if (newValue === oldValue) { + return false; } - NotificationsManager.savePeerSettings(-$scope.chatID, settings); + NotificationsManager.getPeerSettings(-$scope.chatID).then(function (settings) { + if (newValue) { + settings.mute_until = 0; + } else { + settings.mute_until = 2000000000; + } + NotificationsManager.savePeerSettings(-$scope.chatID, settings); + }); }); }); + $scope.leaveGroup = function () { MtpApiManager.invokeApi('messages.deleteChatUser', { chat_id: $scope.chatID, @@ -843,34 +852,44 @@ angular.module('myApp.controllers', []) $scope.notify.desktop = !settings[0]; $scope.notify.sound = !settings[1]; $scope.send.enter = settings[2] ? '' : '1'; - }); - $scope.$watch('notify.sound', function(newValue) { - if (newValue) { - AppConfigManager.remove('notify_nosound'); - } else { - AppConfigManager.set({notify_nosound: true}); - NotificationsManager.clear(); - } - }); + $scope.$watch('notify.sound', function(newValue, oldValue) { + if (newValue === oldValue) { + return false; + } + if (newValue) { + AppConfigManager.remove('notify_nosound'); + } else { + AppConfigManager.set({notify_nosound: true}); + NotificationsManager.clear(); + } + }); - $scope.$watch('notify.desktop', function(newValue) { - if (newValue) { - AppConfigManager.remove('notify_nodesktop'); - } else { - AppConfigManager.set({notify_nodesktop: true}); - } - }); + $scope.$watch('notify.desktop', function(newValue, oldValue) { + if (newValue === oldValue) { + return false; + } + if (newValue) { + AppConfigManager.remove('notify_nodesktop'); + } else { + AppConfigManager.set({notify_nodesktop: true}); + } + }); - $scope.$watch('send.enter', function(newValue) { - if (newValue) { - AppConfigManager.remove('send_ctrlenter'); - } else { - AppConfigManager.set({send_ctrlenter: true}); - } - $rootScope.$broadcast('settings_changed'); + $scope.$watch('send.enter', function(newValue, oldValue) { + if (newValue === oldValue) { + return false; + } + if (newValue) { + AppConfigManager.remove('send_ctrlenter'); + } else { + AppConfigManager.set({send_ctrlenter: true}); + } + $rootScope.$broadcast('settings_changed'); + }); }); + $scope.error = {}; $scope.save = function (profileForm) { MtpApiManager.invokeApi('account.updateProfile', { diff --git a/js/directives.js b/js/directives.js index f71d6d91..7308be7a 100644 --- a/js/directives.js +++ b/js/directives.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/filters.js b/js/filters.js index e527207b..a85a1b1d 100644 --- a/js/filters.js +++ b/js/filters.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/lib/aes_worker.js b/js/lib/aes_worker.js index e79f4772..61b17d10 100644 --- a/js/lib/aes_worker.js +++ b/js/lib/aes_worker.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/lib/mtproto.js b/js/lib/mtproto.js index 09d1ed60..4c91d0d1 100644 --- a/js/lib/mtproto.js +++ b/js/lib/mtproto.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -1502,28 +1502,27 @@ factory('MtpSha1Service', function ($q) { factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerator, MtpSecureRandom, MtpSha1Service, MtpAesService, AppConfigManager, $http, $q, $timeout, $interval) { - var updatesProcessor; + var updatesProcessor, + iii = 0, + offline = false; + + function MtpNetworker(dcID, authKey, serverSalt, options) { + options = options || {}; - function MtpNetworker(dcID, authKey, serverSalt) { this.dcID = dcID; + this.iii = iii++; this.authKey = authKey; this.authKeyID = sha1Hash(authKey).slice(-8); this.serverSalt = serverSalt; - // if (1 == dcID) { - // var self = this; - // (function () { - // console.log('update server salt'); - // self.serverSalt = [0,0,0,0,0,0,0,0]; - // $timeout(arguments.callee, nextRandomInt(2000, 12345)); - // })(); - // } + this.upload = options.upload || false; this.updateSession(); this.currentRequests = 0; + this.checkConnectionPeriod = 0; this.sentMessages = {}; this.serverMessages = []; @@ -1540,7 +1539,7 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato this.checkLongPoll(); }; - MtpNetworker.prototype.updateSession = function (updateMessageID) { + MtpNetworker.prototype.updateSession = function () { console.log('Update session'); this.seqNo = 0; this.sessionID = new Array(8); @@ -1638,13 +1637,18 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato if (!this.connectionInited) { serializer.storeInt(962726977, 'InokeWithLayer10'); serializer.storeInt(0x69796de9, 'initConnection'); - serializer.storeInt(777, 'api_id'); + serializer.storeInt(2496, 'api_id'); serializer.storeString(navigator.userAgent || 'Unknown UserAgent', 'device_model'); serializer.storeString(navigator.platform || 'Unknown Platform', 'system_version'); serializer.storeString('0.1', 'app_version'); serializer.storeString(navigator.language || 'en', 'lang_code'); } + if (options.afterMessageID) { + serializer.storeInt(0xcb9f372d, 'invokeAfterMsg'); + serializer.storeLong(options.afterMessageID, 'msg_id'); + } + serializer.storeMethod(method, params); var messageID = MtpMessageIdGenerator.generateID(), @@ -1657,7 +1661,7 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato }; if (window._debugMode) { - console.log('Api call', method, params, messageID, seqNo) + console.log('Api call', method, params, messageID, seqNo, options); } else { console.log('Api call', method, messageID, seqNo); } @@ -1668,12 +1672,12 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato MtpNetworker.prototype.checkLongPoll = function(force) { var isClean = this.cleanupSent(); // console.log('Check lp', this.longPollPending, tsNow()); - if (this.longPollPending && tsNow() < this.longPollPending) { + if (this.longPollPending && tsNow() < this.longPollPending || this.offline) { return false; } var self = this; AppConfigManager.get('dc').then(function (baseDcID) { - if (baseDcID != self.dcID && isClean) { + if (isClean && (baseDcID != self.dcID || self.upload)) { // console.warn('send long-poll for guest DC is delayed', self.dcID); return; } @@ -1682,15 +1686,25 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato }; MtpNetworker.prototype.sendLongPoll = function() { - var maxWait = 25000; + var maxWait = 25000, + self = this; + this.longPollPending = tsNow() + maxWait; // console.log('Set lp', this.longPollPending, tsNow()); - this.wrapMtpCall('http_wait', {max_delay: 0, wait_after: 0, max_wait: maxWait}, {noResponse: true}). - then((function () { - delete this.longPollPending; - $timeout(this.checkLongPoll.bind(this), 0); - }).bind(this)); + this.wrapMtpCall('http_wait', { + max_delay: 0, + wait_after: 0, + max_wait: maxWait + }, { + noResponse: true + }).then(function () { + delete self.longPollPending; + $timeout(self.checkLongPoll.bind(self), 0); + }, function () { + console.log('Long-poll failed'); + }); + }; MtpNetworker.prototype.pushMessage = function(message, options) { @@ -1702,6 +1716,9 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato if (!options || !options.noShedule) { this.sheduleRequest(); } + if (angular.isObject(options)) { + options.messageID = message.msg_id; + } return deferred.promise; }; @@ -1741,9 +1758,74 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato }); }; + MtpNetworker.prototype.checkConnection = function(event) { + console.log('check connection', event); + $timeout.cancel(this.checkConnectionPromise); + + var serializer = new TLSerialization({mtproto: true}), + pingID = [nextRandomInt(0xFFFFFFFF), nextRandomInt(0xFFFFFFFF)]; + + serializer.storeMethod('ping', {ping_id: pingID}); + + var pingMessage = { + msg_id: MtpMessageIdGenerator.generateID(), + seq_no: this.generateSeqNo(true), + body: serializer.getBytes() + }; + + var self = this; + this.sendEncryptedRequest(pingMessage).then(function (result) { + self.toggleOffline(false); + }, function () { + console.log('delay ', self.checkConnectionPeriod * 1000); + self.checkConnectionPromise = $timeout(self.checkConnection.bind(self), parseInt(self.checkConnectionPeriod * 1000)); + self.checkConnectionPeriod = Math.min(60, self.checkConnectionPeriod * 1.5); + }) + }; + + MtpNetworker.prototype.toggleOffline = function(enabled) { + console.log('toggle ', enabled, this.dcID, this.iii); + if (this.offline == enabled) { + return false; + } + + this.offline = enabled; + + if (this.offline) { + $timeout.cancel(this.nextReqPromise); + delete this.nextReq; + + if (this.checkConnectionPeriod < 1.5) { + this.checkConnectionPeriod = 0; + } + + this.checkConnectionPromise = $timeout(this.checkConnection.bind(this), parseInt(this.checkConnectionPeriod * 1000)); + this.checkConnectionPeriod = Math.min(60, (1 + this.checkConnectionPeriod) * 1.5); + + this.onOnlineCb = this.checkConnection.bind(this); + + $(document.body).on('online', this.onOnlineCb); + } else { + delete this.longPollPending; + this.checkLongPoll(); + this.sheduleRequest(); + + if (this.onOnlineCb) { + $(document.body).off('online', this.onOnlineCb); + } + $timeout.cancel(this.checkConnectionPromise); + } + + }; + + MtpNetworker.prototype.performSheduledRequest = function() { - // console.log('start sheduled'); + // console.trace('sheduled', this.dcID, this.iii); + if (this.offline) { + console.log('cancel sheduled'); + return false; + } delete this.nextReq; if (this.pendingAcks.length) { var ackMsgIDs = []; @@ -1846,7 +1928,32 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato }); self.checkLongPoll(); + + this.checkConnectionPeriod = Math.max(1.1, Math.sqrt(this.checkConnectionPeriod)); + + }); + }, function (error) { + console.log('Encrypted request failed', error); + + if (message.container) { + angular.forEach(message.inner, function (msgID) { + self.pendingMessages[msgID] = 0; + }); + delete self.sentMessages[message.msg_id]; + } else { + self.pendingMessages[message.msg_id] = 0; + } + + angular.forEach(noResponseMsgs, function (msgID) { + if (self.sentMessages[msgID]) { + var deferred = self.sentMessages[msgID].deferred; + delete self.sentMessages[msgID]; + delete self.pendingMessages[msgID]; + deferred.reject(); + } }); + + self.toggleOffline(true); }); }; @@ -1970,6 +2077,9 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato }; MtpNetworker.prototype.sheduleRequest = function (delay) { + if (this.offline) { + this.checkConnection('forced shedule'); + } var nextReq = tsNow() + delay; if (delay && this.nextReq && this.nextReq <= nextReq) { @@ -1979,9 +2089,9 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato // console.log('shedule req', delay); // console.trace(); - clearTimeout(this.nextReqTO); + $timeout.cancel(this.nextReqPromise); - this.nextReqTO = $timeout(this.performSheduledRequest.bind(this), delay || 0); + this.nextReqPromise = $timeout(this.performSheduledRequest.bind(this), delay || 0); this.nextReq = nextReq; }; @@ -2173,8 +2283,8 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato }; return { - getNetworker: function (dcID, authKey, serverSalt) { - return new MtpNetworker(dcID, authKey, serverSalt); + getNetworker: function (dcID, authKey, serverSalt, options) { + return new MtpNetworker(dcID, authKey, serverSalt, options); }, setUpdatesProcessor: function (callback) { updatesProcessor = callback; @@ -2185,6 +2295,7 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworkerFactory, $q) { var cachedNetworkers = {}, + cachedUploadNetworkers = {}, cachedExportPromise = {}, baseDcID = false; @@ -2211,13 +2322,14 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker }); } - function mtpGetNetworker (dcID) { + function mtpGetNetworker (dcID, upload) { + var cache = upload ? cachedUploadNetworkers : cachedNetworkers; if (!dcID) { throw new Exception('get Networker without dcID'); } - if (cachedNetworkers[dcID] !== undefined) { - return $q.when(cachedNetworkers[dcID]); + if (cache[dcID] !== undefined) { + return $q.when(cache[dcID]); } var akk = 'dc' + dcID + '_auth_key', @@ -2225,8 +2337,8 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker return AppConfigManager.get(akk, ssk).then(function (result) { - if (cachedNetworkers[dcID] !== undefined) { - return cachedNetworkers[dcID]; + if (cache[dcID] !== undefined) { + return cache[dcID]; } var authKeyHex = result[0], @@ -2236,7 +2348,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker var authKey = bytesFromHex(authKeyHex); var serverSalt = bytesFromHex(serverSaltHex); - return cachedNetworkers[dcID] = MtpNetworkerFactory.getNetworker(dcID, authKey, serverSalt); + return cache[dcID] = MtpNetworkerFactory.getNetworker(dcID, authKey, serverSalt, {upload: upload}); } return MtpAuthorizer.auth(dcID).then(function (auth) { @@ -2245,7 +2357,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker storeObj[ssk] = bytesToHex(auth.serverSalt); AppConfigManager.set(storeObj); - return cachedNetworkers[dcID] = MtpNetworkerFactory.getNetworker(dcID, auth.authKey, auth.serverSalt); + return cache[dcID] = MtpNetworkerFactory.getNetworker(dcID, auth.authKey, auth.serverSalt, {upload: upload}); }, function (error) { console.log('Get networker error', error, error.stack); return $q.reject(error); @@ -2258,13 +2370,14 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker var deferred = $q.defer(), dcID, + upload = options.fileDownload || options.fileUpload, networkerPromise; if (dcID = options.dcID) { - networkerPromise = mtpGetNetworker(dcID); + networkerPromise = mtpGetNetworker(dcID, upload); } else { networkerPromise = AppConfigManager.get('dc').then(function (baseDcID) { - return mtpGetNetworker(dcID = baseDcID || 1); + return mtpGetNetworker(dcID = baseDcID || 1, upload); }); } @@ -2543,7 +2656,10 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) { location: angular.extend({}, location, {_: 'inputFileLocation'}), offset: 0, limit: 0 - }, {dcID: location.dc_id}); + }, { + dcID: location.dc_id, + fileDownload: true + }); }); fileEntry.createWriter(function (fileWriter) { @@ -2577,7 +2693,10 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) { location: angular.extend({}, location, {_: 'inputFileLocation'}), offset: 0, limit: 0 - }, {dcID: location.dc_id}); + }, { + dcID: location.dc_id, + fileDownload: true + }); }).then(function (result) { deferred.resolve(cachedDownloads[fileName] = 'data:image/jpeg;base64,' + bytesToBase64(result.bytes)) }, errorHandler); @@ -2624,7 +2743,10 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) { location: location, offset: offset, limit: limit - }, {dcID: dcID}); + }, { + dcID: dcID, + fileDownload: true + }); }, 6).then(function (result) { @@ -2692,7 +2814,10 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) { location: location, offset: offset, limit: limit - }, {dcID: dcID}); + }, { + dcID: dcID, + fileDownload: true + }); }, 6).then(function (result) { writeBlobPromise.then(function () { try { @@ -2813,7 +2938,10 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) { file_id: fileID, file_part: part, bytes: bytesFromArrayBuffer(e.target.result) - }, {startMaxLength: partSize + 256}); + }, { + startMaxLength: partSize + 256, + fileUpload: true + }); }, errorHandler); apiCurPromise.then(function (result) { diff --git a/js/lib/pq_worker.js b/js/lib/pq_worker.js index 12e63229..193a2985 100644 --- a/js/lib/pq_worker.js +++ b/js/lib/pq_worker.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/lib/sha1_worker.js b/js/lib/sha1_worker.js index b2feaed0..ce08771b 100644 --- a/js/lib/sha1_worker.js +++ b/js/lib/sha1_worker.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/services.js b/js/services.js index eaa67a68..b2d1c4a2 100644 --- a/js/services.js +++ b/js/services.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -570,6 +570,7 @@ angular.module('myApp.services', []) var dialogsStorage = {count: null, dialogs: []}; var pendingByRandomID = {}; var pendingByMessageID = {}; + var pendingAfterMsgs = {}; var tempID = -1; @@ -958,11 +959,18 @@ angular.module('myApp.services', []) message.send = function () { toggleError(false); + var sentRequestOptions = {}; + if (pendingAfterMsgs[peerID]) { + sentRequestOptions.afterMessageID = pendingAfterMsgs[peerID].messageID; + } MtpApiManager.invokeApi('messages.sendMessage', { peer: inputPeer, message: text, random_id: randomID - }).then(function (result) { + }, sentRequestOptions).then(function (result) { + if (pendingAfterMsgs[peerID] === sentRequestOptions) { + delete pendingAfterMsgs[peerID]; + } if (ApiUpdatesManager.saveSeq(result.seq)) { ApiUpdatesManager.saveUpdate({ _: 'updateMessageID', @@ -981,6 +989,8 @@ angular.module('myApp.services', []) }, function (error) { toggleError(true); }); + + pendingAfterMsgs[peerID] = sentRequestOptions; }; saveMessages([message]); @@ -1016,8 +1026,6 @@ angular.module('myApp.services', []) attachType = 'doc'; } - console.log(11, options.isMedia, file.type, attachType); - if (historyStorage === undefined) { historyStorage = historiesStorage[peerID] = {count: null, history: [], pending: []}; } @@ -1347,7 +1355,9 @@ angular.module('myApp.services', []) } $rootScope.$on('apiUpdate', function (e, update) { - // console.log('on apiUpdate', update); + // if (update._ != 'updateUserStatus') { + // console.log('on apiUpdate', update); + // } switch (update._) { case 'updateMessageID': pendingByMessageID[update.id] = update.random_id; diff --git a/js/util.js b/js/util.js index f18813d3..d49edbd6 100644 --- a/js/util.js +++ b/js/util.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.17 - messaging web application for MTProto + * Webogram v0.0.18 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/manifest.json b/manifest.json index fe9b0fcf..c490d4b8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Telegram UNOFFICIAL", - "version": "0.0.17", + "version": "0.0.18", "short_name": "Webogram", "manifest_version": 2, "app": { diff --git a/manifest.webapp b/manifest.webapp index 22420c5c..8589f6e3 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -1,7 +1,7 @@ { "name": "Webogram", "description": "Webogram – UNOFFICIAL Telegram Web App.\nMore info & source code here: https://github.com/zhukov/webogram", - "version": "0.0.17", + "version": "0.0.18", "launch_path": "/index.html", "developer": { "name": "Igor Zhukov", diff --git a/partials/chat_modal.html b/partials/chat_modal.html index e2454a23..d8faf49e 100644 --- a/partials/chat_modal.html +++ b/partials/chat_modal.html @@ -1,7 +1,7 @@
diff --git a/partials/contacts_modal.html b/partials/contacts_modal.html index c2d629e4..32cd0e65 100644 --- a/partials/contacts_modal.html +++ b/partials/contacts_modal.html @@ -1,7 +1,7 @@
diff --git a/partials/error_modal.html b/partials/error_modal.html index 26a0b5c2..50e2ac2e 100644 --- a/partials/error_modal.html +++ b/partials/error_modal.html @@ -1,7 +1,7 @@
diff --git a/partials/settings_modal.html b/partials/settings_modal.html index d37e894b..435720b6 100644 --- a/partials/settings_modal.html +++ b/partials/settings_modal.html @@ -1,7 +1,7 @@
@@ -61,7 +61,7 @@

Version: - alpha 0.0.17 + alpha 0.0.18


diff --git a/partials/user_modal.html b/partials/user_modal.html index 8dc0e3b9..18691f61 100644 --- a/partials/user_modal.html +++ b/partials/user_modal.html @@ -1,7 +1,7 @@
diff --git a/vendor/ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.js b/vendor/ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.js index bebf9ccd..0702a7bf 100644 --- a/vendor/ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.js +++ b/vendor/ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.js @@ -1074,7 +1074,7 @@ angular.module("template/modal/backdrop.html", []).run(["$templateCache", functi angular.module("template/modal/window.html", []).run(["$templateCache", function($templateCache) { $templateCache.put("template/modal/window.html", "
\n" + - "
\n" + + "
\n" + "
\n" + "
\n" + "
\n" +