diff --git a/app/js/controllers.js b/app/js/controllers.js index 3f55a6cd..b17fccfc 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -4660,7 +4660,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) }) - .controller('StickersetModalController', function ($scope, MtpApiManager, AppStickersManager) { + .controller('StickersetModalController', function ($scope, MtpApiManager, RichTextProcessor, AppStickersManager) { $scope.slice = {limit: 20, limitDelta: 20}; AppStickersManager.getStickerset($scope.inputStickerset).then(function (result) { @@ -4669,6 +4669,31 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.stickerset = result.set; $scope.stickersetInstalled = result.installed; $scope.documents = result.documents; + + $scope.stickerEmojis = {}; + angular.forEach($scope.documents, function (doc) { + $scope.stickerEmojis[doc.id] = RichTextProcessor.wrapRichText(doc.stickerEmojiRaw, { + noLinks: true, + noLinebreaks: true, + emojiIconSize: 26 + }); + }); + + // if (doc.id && doc.access_hash) { + // var inputMedia = { + // _: 'inputMediaDocument', + // id: { + // _: 'inputDocument', + // id: doc.id, + // access_hash: doc.access_hash + // } + // } + // var options = { + // replyToMsgID: $scope.draftMessage.replyToMessage && $scope.draftMessage.replyToMessage.mid + // }; + // AppMessagesManager.sendOther($scope.curDialog.peerID, inputMedia, options); + // $scope.$broadcast('ui_message_send'); + // } }); $scope.toggleInstalled = function (installed) { diff --git a/app/js/directives.js b/app/js/directives.js index a33afcdf..e0a6656c 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -1074,7 +1074,7 @@ angular.module('myApp.directives', ['myApp.filters']) function updateSizes () { $(element).css({ - height: Math.min(500, $($window).height() + height: Math.min(600, $($window).height() - (Config.Mobile ? 46 + 18 : 200)) }); $(stickersWrap).nanoScroller(); diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index 041fd835..8ac34382 100644 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -1484,6 +1484,7 @@ angular.module('izhukov.utils', []) var url; var html = []; var lastOffset = 0; + var curEmojiSize = options.emojiIconSize || emojiIconSize; for (i = 0; i < len; i++) { entity = entities[i]; if (entity.offset > lastOffset) { @@ -1600,9 +1601,9 @@ angular.module('izhukov.utils', []) '', ':', entity.title, ':' @@ -1675,8 +1676,9 @@ angular.module('izhukov.utils', []) if (!options.nested && (emojiFound || options.hasNested)) { text = text.replace(/\ufe0f|️|�|‍/g, '', text); + var emojiSizeClass = curEmojiSize == 18 ? '' : (' emoji-w' + curEmojiSize); text = text.replace(//g, - ''); + ''); } return $sce.trustAs('html', text); diff --git a/app/js/messages_manager.js b/app/js/messages_manager.js index 36d05498..dfd0fbf0 100644 --- a/app/js/messages_manager.js +++ b/app/js/messages_manager.js @@ -1051,7 +1051,16 @@ angular.module('myApp.services') apiPromise = MtpApiManager.invokeApi('messages.readHistory', { peer: AppPeersManager.getInputPeerByID(peerID), max_id: 0 - }); + }).then(function (affectedMessages) { + ApiUpdatesManager.processUpdateMessage({ + _: 'updateShort', + update: { + _: 'updatePts', + pts: affectedMessages.pts, + pts_count: affectedMessages.pts_count + } + }); + }) } historyStorage.readPromise = apiPromise.then(function () { diff --git a/app/js/services.js b/app/js/services.js index 30187d63..a46f6500 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -2650,6 +2650,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) } function getDifference () { + console.trace(dT(), 'Get full diff'); if (!updatesState.syncLoading) { updatesState.syncLoading = true; updatesState.pendingSeqUpdates = {}; @@ -2721,12 +2722,18 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) channelState.syncLoading = true; channelState.pendingPtsUpdates = []; } + if (channelState.syncPending) { + clearTimeout(channelState.syncPending.timeout); + channelState.syncPending = false; + } + console.log(dT(), 'Get channel diff', AppChatsManager.getChat(channelID), channelState.pts); MtpApiManager.invokeApi('updates.getChannelDifference', { channel: AppChatsManager.getChannelInput(channelID), filter: {_: 'channelMessagesFilterEmpty'}, pts: channelState.pts, - limit: 10 + limit: 30 }).then(function (differenceResult) { + console.log(dT(), 'channel diff result', differenceResult); channelState.pts = differenceResult.pts; if (differenceResult._ == 'updates.channelDifferenceEmpty') { @@ -2809,12 +2816,16 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) channelID = update.channel_id; break; } + // if (channelID) { + // console.log(dT(), channelID, update.pts, update); + // } if (channelID && !AppChatsManager.hasChat(channelID)) { + console.log(dT(), 'skip update, missing channel', channelID, update); return false; } var curState = channelID ? getChannelState(channelID, update.pts) : updatesState; - // console.log('process', channelID, curState, update); + console.log(dT(), 'process', channelID, curState, update); if (curState.syncLoading) { return false; @@ -2840,7 +2851,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) if (update.pts) { var newPts = curState.pts + (update.pts_count || 0); if (newPts < update.pts) { - console.log(dT(), 'Pts hole', curState, update); + console.warn(dT(), 'Pts hole', curState, update, channelID && AppChatsManager.getChat(channelID)); curState.pendingPtsUpdates.push(update); if (!curState.syncPending) { curState.syncPending = { @@ -2860,6 +2871,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) curState.pts = update.pts; popPts = true; } + if (channelID && options.date && updatesState.date < options.date) { + updatesState.date = options.date; + } } else if (!channelID && options.seq > 0) { var seq = options.seq; diff --git a/app/less/app.less b/app/less/app.less index 33e55111..4757e77e 100644 --- a/app/less/app.less +++ b/app/less/app.less @@ -3366,28 +3366,34 @@ ul.chat_modal_migrate_list { .stickerset_modal_window .modal-dialog { - max-width: 474px; + max-width: 642px; + width: auto; } .stickerset_modal_stickers_list { padding: 25px; } .stickerset_modal_sticker_wrap { - list-style: none; - margin: 0 10px 10px 0; + margin: 0 5px 5px 0; padding: 0; position: relative; display: block; - width: 96px; - height: 96px; + width: 192px; + height: 192px; float: left; + border-radius: 3px; + overflow: hidden; + + &:hover { + background: #f2f6fa; + } } .stickerset_modal_sticker { - width: 96px; - height: 96px; + width: 192px; + height: 192px; } .stickerset_modal_sticker img { - max-width: 96px; - max-height: 96px; + max-width: 192px; + max-height: 192px; } .stickerset_modal_sticker_alt { position: absolute; diff --git a/app/partials/desktop/stickerset_modal.html b/app/partials/desktop/stickerset_modal.html index 53100561..4039b37e 100644 --- a/app/partials/desktop/stickerset_modal.html +++ b/app/partials/desktop/stickerset_modal.html @@ -26,10 +26,10 @@
-
-
-
-
+ +
+
+