Browse Source

merged with master

gh-pages
Igor Zhukov 11 years ago
parent
commit
443dff00eb
  1. 2
      css/app.css
  2. 2
      js/app.js
  3. 2
      js/background.js
  4. 99
      js/controllers.js
  5. 2
      js/directives.js
  6. 2
      js/filters.js
  7. 2
      js/lib/aes_worker.js
  8. 210
      js/lib/mtproto.js
  9. 2
      js/lib/pq_worker.js
  10. 2
      js/lib/sha1_worker.js
  11. 20
      js/services.js
  12. 2
      js/util.js
  13. 2
      manifest.json
  14. 2
      manifest.webapp
  15. 2
      partials/chat_modal.html
  16. 2
      partials/contacts_modal.html
  17. 2
      partials/error_modal.html
  18. 4
      partials/settings_modal.html
  19. 2
      partials/user_modal.html
  20. 2
      vendor/ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.js

2
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;

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

99
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 <igor.beatle@gmail.com>
* 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', {

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

210
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 <igor.beatle@gmail.com>
* 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) {

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

20
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 <igor.beatle@gmail.com>
* 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;

2
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 <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
manifest.json

@ -1,6 +1,6 @@
{
"name": "Telegram UNOFFICIAL",
"version": "0.0.17",
"version": "0.0.18",
"short_name": "Webogram",
"manifest_version": 2,
"app": {

2
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",

2
partials/chat_modal.html

@ -1,7 +1,7 @@
<div class="chat_modal_wrap">
<div class="modal-header">
<a class="modal-close-link visible-xs visible-sm" ng-click="$close()">Close</a>
<a class="modal-close-link" ng-click="$close()">Close</a>
<h4 class="modal-title">Group Info</h4>
</div>

2
partials/contacts_modal.html

@ -1,7 +1,7 @@
<div class="contacts_modal_wrap">
<div class="modal-header">
<a class="modal-close-link visible-xs visible-sm" ng-click="$close()">Close</a>
<a class="modal-close-link" ng-click="$close()">Close</a>
<h4 class="modal-title">Contacts</h4>
</div>

2
partials/error_modal.html

@ -1,7 +1,7 @@
<div class="error_modal_wrap">
<div class="modal-header">
<a class="modal-close-link visible-xs visible-sm" ng-click="$close()">Close</a>
<a class="modal-close-link" ng-click="$close()">Close</a>
<h4 class="modal-title">{{title}}</h4>
</div>

4
partials/settings_modal.html

@ -1,7 +1,7 @@
<div class="settings_modal_wrap">
<div class="modal-header">
<a class="modal-close-link visible-xs visible-sm" ng-click="$close()">Close</a>
<a class="modal-close-link" ng-click="$close()">Close</a>
<h4 class="modal-title">Settings</h4>
</div>
@ -61,7 +61,7 @@
<p>
<strong>Version: </strong>
<span class="settings_version">alpha 0.0.17</span>
<span class="settings_version">alpha 0.0.18</span>
</p>
<hr/>

2
partials/user_modal.html

@ -1,7 +1,7 @@
<div class="user_modal_wrap">
<div class="modal-header">
<a class="modal-close-link visible-xs visible-sm" ng-click="$close()">Close</a>
<a class="modal-close-link" ng-click="$close()">Close</a>
<h4 class="modal-title">Info</h4>
</div>

2
vendor/ui-bootstrap/ui-bootstrap-custom-tpls-0.10.0.js vendored

@ -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",
"<div tabindex=\"-1\" class=\"modal fade {{ windowClass }}\" ng-class=\"{in: animate}\" ng-style=\"{'z-index': 1050 + index*10, display: 'block'}\" ng-click=\"close($event)\">\n" +
" <div class=\"modal_close_wrap visible-md visible-lg\" ng-click=\"close($event)\">\n" +
" <div class=\"modal_close_wrap hidden-xs hidden-sm\" ng-click=\"close($event)\">\n" +
" <div class=\"modal_close\"></div>\n" +
" </div>\n" +
" <div class=\"modal-dialog\"><div class=\"modal-content\" ng-transclude></div></div>\n" +

Loading…
Cancel
Save