Browse Source

Bugfixes

master
Igor Zhukov 9 years ago
parent
commit
807b30a3be
  1. 5
      app/js/controllers.js
  2. 7
      app/js/directives.js
  3. 2
      app/js/lib/mtproto_wrapper.js
  4. 9
      app/js/services.js

5
app/js/controllers.js

@ -1507,7 +1507,9 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1507,7 +1507,9 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}, 2800);
}
if (!$rootScope.idle.isIDLE) {
AppMessagesManager.readHistory($scope.curDialog.peerID);
}
updateBotActions();
updateChannelActions();
@ -2074,7 +2076,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -2074,7 +2076,8 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
if (!newVal) {
unreadAfterIdle = false;
if (loadAfterSync == $scope.curDialog.peerID) {
if (loadAfterSync &&
loadAfterSync == $scope.curDialog.peerID) {
loadHistory();
loadAfterSync = false;
}

7
app/js/directives.js

@ -2064,8 +2064,11 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2064,8 +2064,11 @@ angular.module('myApp.directives', ['myApp.filters'])
height: $scope.document.thumb.height
});
var smallLocation = angular.copy($scope.document.thumb.location);
var smallLocation = false;
if ($scope.document.thumb.location) {
smallLocation = angular.copy($scope.document.thumb.location);
smallLocation.sticker = true;
}
var fullLocation = {
_: 'inputDocumentFileLocation',
@ -2094,7 +2097,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2094,7 +2097,7 @@ angular.module('myApp.directives', ['myApp.filters'])
imgElement.attr('src', emptySrc).appendTo(element);
}
if (attrs.thumb) {
if (attrs.thumb && smallLocation) {
MtpApiFileManager.downloadSmallFile(smallLocation).then(function (blob) {
setSrc(blob);
}, function (e) {

2
app/js/lib/mtproto_wrapper.js

@ -228,7 +228,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto']) @@ -228,7 +228,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
performRequest(cachedNetworker);
}, waitTime * 1000);
}
else if (!options.rawError && error.code == 500) {
else if (!options.rawError && (error.code == 500 || error.type == 'MSG_WAIT_FAILED')) {
var now = tsNow();
if (options.stopTime) {
if (now >= options.stopTime) {

9
app/js/services.js

@ -152,11 +152,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -152,11 +152,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var timeNow = tsNow(true) + serverTimeOffset;
switch (status._) {
case 'userStatusRecently':
return tsNow(true) + serverTimeOffset - 86400 * 3;
return timeNow - 86400 * 3;
case 'userStatusLastWeek':
return tsNow(true) + serverTimeOffset - 86400 * 7;
return timeNow - 86400 * 7;
case 'userStatusLastMonth':
return tsNow(true) + serverTimeOffset - 86400 * 30;
return timeNow - 86400 * 30;
}
}
@ -1064,6 +1064,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1064,6 +1064,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
if (chatFullPromises[id] !== undefined) {
return chatFullPromises[id];
}
// console.trace('get chat full');
return chatFullPromises[id] = MtpApiManager.invokeApi('messages.getFullChat', {
chat_id: AppChatsManager.getChatInput(id)
}).then(function (result) {
@ -1257,7 +1258,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1257,7 +1258,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
if (!chat.photo || !fullChat) {
return;
}
var emptyPhoto = chat.photo == 'chatPhotoEmpty';
var emptyPhoto = chat.photo._ == 'chatPhotoEmpty';
if (emptyPhoto != (fullChat.chat_photo._ == 'photoEmpty')) {
delete chatsFull[chatID];
$rootScope.$broadcast('chat_full_update', chatID);

Loading…
Cancel
Save