From 7d77145ebbf1e6b42a8592bd1fd80edc5e798829 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 22 Oct 2015 14:34:42 +0200 Subject: [PATCH] New forward messages --- app/js/controllers.js | 274 ++++--- app/js/directives.js | 107 +-- app/js/directives_mobile.js | 5 - app/js/lib/utils.js | 1 + app/js/locales/en-us.json | 1 + app/js/messages_manager.js | 685 ++++++++++-------- app/js/services.js | 9 +- app/less/app.less | 84 +-- app/less/desktop.less | 16 +- app/less/mobile.less | 2 +- app/partials/desktop/forwarded_messages.html | 45 ++ app/partials/desktop/im.html | 7 +- app/partials/desktop/peer_select.html | 2 +- app/partials/desktop/reply_message.html | 4 +- app/partials/mobile/head.html | 2 +- app/partials/mobile/im.html | 12 +- app/partials/mobile/message.html | 2 - .../mobile/message_actions_modal.html | 4 +- 18 files changed, 695 insertions(+), 567 deletions(-) create mode 100644 app/partials/desktop/forwarded_messages.html diff --git a/app/js/controllers.js b/app/js/controllers.js index b381730b..cc77d8d7 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -413,7 +413,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.$on('$routeUpdate', updateCurDialog); var pendingParams = false; - var pendingShare = false; + var pendingAttachment = false; $scope.$on('history_focus', function (e, peerData) { $modalStack.dismissAll(); if (peerData.peerString == $scope.curDialog.peer && @@ -424,7 +424,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) var peerID = AppPeersManager.getPeerID(peerData.peerString); var username = AppPeersManager.getPeer(peerID).username; var peer = username ? '@' + username : peerData.peerString; - if (peerData.messageID || peerData.startParam || peerData.shareUrl) { + if (peerData.messageID || peerData.startParam) { pendingParams = { messageID: peerData.messageID, startParam: peerData.startParam @@ -432,11 +432,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) } else { pendingParams = false; } - if (peerData.shareUrl) { - pendingShare = { - url: peerData.shareUrl, - text: peerData.shareText - }; + if (peerData.attachment) { + pendingAttachment = peerData.attachment; } if ($routeParams.p != peer) { $location.url('/im?p=' + peer); @@ -619,9 +616,9 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.curDialog = angular.extend({ peer: peerString }, addParams); - if (pendingShare) { - $scope.$broadcast('peer_share', pendingShare); - pendingShare = false; + if (pendingAttachment) { + $scope.$broadcast('peer_draft_attachment', pendingAttachment); + pendingAttachment = false; } }); } @@ -1072,6 +1069,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) documents: 'inputMessagesFilterDocument', audio: 'inputMessagesFilterAudio' }, + unfocusMessagePromise, jump = 0, moreJump = 0, moreActive = false, @@ -1258,8 +1256,18 @@ angular.module('myApp.controllers', ['myApp.i18n']) if (history && history.ids.indexOf($scope.curDialog.messageID) != -1) { $scope.historyUnread = {}; - $scope.$broadcast('messages_focus', $scope.curDialog.messageID); + var focusedMsgID = $scope.curDialog.messageID || 0; + $scope.$broadcast('messages_focus', focusedMsgID); $scope.$broadcast('ui_history_change_scroll', true); + + $timeout.cancel(unfocusMessagePromise); + if (focusedMsgID) { + unfocusMessagePromise = $timeout(function () { + if ($scope.curDialog.messageID == focusedMsgID) { + $scope.$broadcast('messages_focus', 0); + } + }, 2800); + } } else { loadHistory(); } @@ -1447,11 +1455,21 @@ angular.module('myApp.controllers', ['myApp.i18n']) delete $scope.historyUnreadAfter; } $scope.$broadcast('messages_unread_after'); + var focusedMsgID = $scope.curDialog.messageID || 0; onContentLoaded(function () { - $scope.$broadcast('messages_focus', $scope.curDialog.messageID || 0); + $scope.$broadcast('messages_focus', focusedMsgID); }); $scope.$broadcast('ui_history_change'); + $timeout.cancel(unfocusMessagePromise); + if (focusedMsgID) { + unfocusMessagePromise = $timeout(function () { + if ($scope.curDialog.messageID == focusedMsgID) { + $scope.$broadcast('messages_focus', 0); + } + }, 2800); + } + AppMessagesManager.readHistory($scope.curDialog.inputPeer); updateBotActions(); @@ -1538,7 +1556,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) if (Config.Mobile) { $modal.open({ templateUrl: templateUrl('message_actions_modal'), - windowClass: 'message_actions_modal_window' + windowClass: 'message_actions_modal_window', + scope: $scope.$new() }).result.then(function (action) { switch (action) { case 'reply': @@ -1662,15 +1681,14 @@ angular.module('myApp.controllers', ['myApp.i18n']) }); } if (selectedMessageIDs.length) { - PeersSelectService.selectPeers({confirm_type: 'FORWARD_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.forwardMessages(peerID, selectedMessageIDs).then(function () { - selectedCancel(); - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerString}); - } - }); + PeersSelectService.selectPeer().then(function (peerString) { + selectedCancel(); + $rootScope.$broadcast('history_focus', { + peerString: peerString, + attachment: { + _: 'fwd_messages', + id: selectedMessageIDs + } }); }); } @@ -2023,7 +2041,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.$watch('curDialog.peer', resetDraft); $scope.$on('user_update', angular.noop); - $scope.$on('peer_share', applyShare); + $scope.$on('peer_draft_attachment', applyDraftAttachment); $scope.$on('reply_selected', function (e, messageID) { replySelect(messageID); }); @@ -2032,7 +2050,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.draftMessage = { text: '', send: sendMessage, - replyClear: replyClear + replyClear: replyClear, + fwdsClear: fwdsClear }; $scope.mentions = {}; $scope.commands = {}; @@ -2051,6 +2070,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.toggleSlash = toggleSlash; var replyToMarkup = false; + var forceDraft = false; function sendMessage (e) { $scope.$broadcast('ui_message_before_send'); @@ -2084,6 +2104,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) } while (text.length); } + fwdsSend(); resetDraft(); $scope.$broadcast('ui_message_send'); @@ -2170,6 +2191,19 @@ angular.module('myApp.controllers', ['myApp.i18n']) replyClear(); updateReplyKeyboard(); + // console.log(dT(), 'reset draft', $scope.curDialog.peer, forceDraft); + if (forceDraft) { + if (forceDraft == $scope.curDialog.peer) { + $scope.draftMessage.isBroadcast = AppPeersManager.isChannel($scope.curDialog.peerID); + $scope.$broadcast('ui_peer_draft'); + return; + } else { + forceDraft = false; + } + } + + fwdsClear(); + if (newPeer) { Storage.get('draft' + $scope.curDialog.peerID).then(function (draftText) { // console.log('Restore draft', 'draft' + $scope.curDialog.peerID, draftText); @@ -2185,20 +2219,33 @@ angular.module('myApp.controllers', ['myApp.i18n']) } } - function applyShare (e, shareData) { - var url = shareData.url; - var text = shareData.text || ''; + function applyDraftAttachment (e, attachment) { + // console.log('apply draft attach', attachment); + if (!attachment || !attachment._) { + return; + } - $timeout(function () { - $scope.draftMessage.text = url + "\n" + text; - $scope.$broadcast('ui_peer_draft', { - customSelection: [ - url + "\n", - text, - '' - ] - }); - }, 1000); + if (attachment._ == 'share_url') { + var url = attachment.url; + var text = attachment.text || ''; + forceDraft = $scope.curDialog.peer; + + $timeout(function () { + $scope.draftMessage.text = url + "\n" + text; + $scope.$broadcast('ui_peer_draft', { + customSelection: [ + url + "\n", + text, + '' + ] + }); + }, 1000); + } + else if (attachment._ == 'fwd_messages') { + forceDraft = $scope.curDialog.peer; + $scope.draftMessage.fwdMessages = attachment.id; + $scope.$broadcast('ui_peer_reply'); + } } function replySelect(messageID) { @@ -2220,6 +2267,29 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.$broadcast('ui_peer_reply'); } + function fwdsClear () { + if ($scope.draftMessage.fwdMessages && + $scope.draftMessage.fwdMessages.length) { + delete $scope.draftMessage.fwdMessages; + $scope.$broadcast('ui_peer_reply'); + + if (forceDraft == $scope.curDialog.peer) { + forceDraft = false; + } + } + } + + function fwdsSend () { + if ($scope.draftMessage.fwdMessages && + $scope.draftMessage.fwdMessages.length) { + var ids = $scope.draftMessage.fwdMessages.slice(); + fwdsClear(); + setTimeout(function () { + AppMessagesManager.forwardMessages($scope.curDialog.peerID, ids); + }, 0); + } + } + function toggleSlash ($event) { if ($scope.draftMessage.text && $scope.draftMessage.text.charAt(0) == '/') { @@ -2319,6 +2389,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) AppMessagesManager.sendFile($scope.curDialog.peerID, newVal[i], options); $scope.$broadcast('ui_message_send'); } + fwdsSend(); } function onStickerSelected (newVal) { @@ -2341,6 +2412,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) }; AppMessagesManager.sendOther($scope.curDialog.peerID, inputMedia, options); $scope.$broadcast('ui_message_send'); + + fwdsSend(); } delete $scope.draftMessage.sticker; resetDraft(); @@ -2402,14 +2475,14 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.forward = function () { var messageID = $scope.messageID; - PeersSelectService.selectPeers({confirm_type: 'FORWARD_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.forwardMessages(peerID, [messageID]).then(function () { - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerString}); - } - }); + + PeersSelectService.selectPeer().then(function (peerString) { + $rootScope.$broadcast('history_focus', { + peerString: peerString, + attachment: { + _: 'fwd_messages', + id: [messageID] + } }); }); }; @@ -2727,21 +2800,17 @@ angular.module('myApp.controllers', ['myApp.i18n']) }; $scope.forward = function () { - PeersSelectService.selectPeers({confirm_type: 'FORWARD_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.sendOther(peerID, { - _: 'inputMediaPhoto', - id: { - _: 'inputPhoto', - id: $scope.photoID, - access_hash: $scope.photo.access_hash, - } - }); - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerStrings[0]}); + PeersSelectService.selectPeer({confirm_type: 'FORWARD_PEER'}).then(function (peerString) { + var peerID = AppPeersManager.getPeerID(peerString); + AppMessagesManager.sendOther(peerID, { + _: 'inputMediaPhoto', + id: { + _: 'inputPhoto', + id: $scope.photoID, + access_hash: $scope.photo.access_hash, } }); + $rootScope.$broadcast('history_focus', {peerString: peerString}); }); }; @@ -2802,21 +2871,17 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.canDelete = isChannel ? chat.pFlags.creator : true; $scope.forward = function () { - PeersSelectService.selectPeers({confirm_type: 'FORWARD_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.sendOther(peerID, { - _: 'inputMediaPhoto', - id: { - _: 'inputPhoto', - id: $scope.photoID, - access_hash: $scope.photo.access_hash, - } - }); - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerStrings[0]}); + PeersSelectService.selectPeer({confirm_type: 'FORWARD_PEER'}).then(function (peerString) { + var peerID = AppPeersManager.getPeerID(peerString); + AppMessagesManager.sendOther(peerID, { + _: 'inputMediaPhoto', + id: { + _: 'inputPhoto', + id: $scope.photoID, + access_hash: $scope.photo.access_hash, } }); + $rootScope.$broadcast('history_focus', {peerString: peerString}); }); }; @@ -2861,14 +2926,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.forward = function () { var messageID = $scope.messageID; - PeersSelectService.selectPeers({confirm_type: 'FORWARD_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.forwardMessages(peerID, [messageID]).then(function () { - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerString}); - } - }); + PeersSelectService.selectPeer().then(function (peerString) { + $rootScope.$broadcast('history_focus', { + peerString: peerString, + attachment: { + _: 'fwd_messages', + id: [messageID] + } }); }); }; @@ -2897,14 +2961,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.forward = function () { var messageID = $scope.messageID; - PeersSelectService.selectPeers({confirm_type: 'FORWARD_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.forwardMessages(peerID, [messageID]).then(function () { - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerString}); - } - }); + PeersSelectService.selectPeer().then(function (peerString) { + $rootScope.$broadcast('history_focus', { + peerString: peerString, + attachment: { + _: 'fwd_messages', + id: [messageID] + } }); }); }; @@ -2935,14 +2998,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.forward = function () { var messageID = $scope.messageID; - PeersSelectService.selectPeers({confirm_type: 'FORWARD_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.forwardMessages(peerID, [messageID]).then(function () { - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerString}); - } - }); + PeersSelectService.selectPeer().then(function (peerString) { + $rootScope.$broadcast('history_focus', { + peerString: peerString, + attachment: { + _: 'fwd_messages', + id: [messageID] + } }); }); }; @@ -3052,20 +3114,16 @@ angular.module('myApp.controllers', ['myApp.i18n']) }; $scope.shareContact = function () { - PeersSelectService.selectPeers({confirm_type: 'SHARE_CONTACT_PEER'}).then(function (peerStrings) { - angular.forEach(peerStrings, function (peerString) { - var peerID = AppPeersManager.getPeerID(peerString); - AppMessagesManager.sendOther(peerID, { - _: 'inputMediaContact', - phone_number: $scope.user.phone, - first_name: $scope.user.first_name, - last_name: $scope.user.last_name, - user_id: $scope.user.id - }); - if (peerStrings.length == 1) { - $rootScope.$broadcast('history_focus', {peerString: peerStrings[0]}); - } + PeersSelectService.selectPeer({confirm_type: 'SHARE_CONTACT_PEER'}).then(function (peerString) { + var peerID = AppPeersManager.getPeerID(peerString); + AppMessagesManager.sendOther(peerID, { + _: 'inputMediaContact', + phone_number: $scope.user.phone, + first_name: $scope.user.first_name, + last_name: $scope.user.last_name, + user_id: $scope.user.id }); + $rootScope.$broadcast('history_focus', {peerString: peerString}); }); } diff --git a/app/js/directives.js b/app/js/directives.js index 586fe7f5..4e019468 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -379,42 +379,7 @@ angular.module('myApp.directives', ['myApp.filters']) $(element).remove(); return; } - var thumbWidth = 42; - var thumbHeight = 42; - var thumbPhotoSize; - var sticker = false; - if (message.media) { - switch (message.media._) { - case 'messageMediaPhoto': - thumbPhotoSize = AppPhotosManager.choosePhotoSize(message.media.photo, thumbWidth, thumbHeight); - break; - - case 'messageMediaDocument': - thumbPhotoSize = message.media.document.thumb; - if (message.media.document.sticker) { - sticker = true; - } - break; - - case 'messageMediaVideo': - thumbPhotoSize = message.media.video.thumb; - break; - } - } - - if (thumbPhotoSize && thumbPhotoSize._ != 'photoSizeEmpty') { - var dim = calcImageInBox(thumbPhotoSize.w, thumbPhotoSize.h, thumbWidth, thumbHeight, true); - - $scope.thumb = { - width: dim.w, - height: dim.h, - location: thumbPhotoSize.location, - size: thumbPhotoSize.size - }; - if (sticker) { - $scope.thumb.location.sticker = true; - } - } + $scope.thumb = AppMessagesManager.getMessageThumb(message, 42, 42); if (element[0].tagName == 'A') { element.on('click', function () { @@ -433,6 +398,57 @@ angular.module('myApp.directives', ['myApp.filters']) }) + .directive('myForwardedMessages', function(AppPhotosManager, AppMessagesManager, AppPeersManager, $rootScope) { + + return { + templateUrl: templateUrl('forwarded_messages'), + scope: { + 'forwardMessages': '=myForwardedMessages' + }, + link: link + }; + + function link ($scope, element, attrs) { + if (attrs.watch) { + $scope.$watch('forwardMessages', function () { + updateMessages($scope, element); + }); + } else { + updateMessages($scope, element); + } + } + + function updateMessages ($scope, element) { + var mids = $scope.forwardMessages; + var length = mids.length; + var fromID = false; + var single = length == 1; + $scope.thumb = false; + $scope.singleMessage = false; + angular.forEach(mids, function (mid) { + var message = AppMessagesManager.getMessage(mid); + if (fromID === false) { + fromID = message.fromID; + } else { + if (fromID !== message.fromID) { + fromID = AppMessagesManager.getMessagePeer(message); + } + } + if (single) { + $scope.thumb = AppMessagesManager.getMessageThumb(message, 42, 42); + $scope.singleMessage = AppMessagesManager.wrapForDialog(mid); + } + }); + $scope.fromID = fromID; + $scope.count = length; + + onContentLoaded(function () { + $scope.$emit('ui_height'); + }) + } + + }) + .directive('myMessageText', function(AppPeersManager, AppMessagesManager, AppUsersManager, RichTextProcessor) { return { link: link, @@ -636,7 +652,6 @@ angular.module('myApp.directives', ['myApp.filters']) searchField = $('.im_dialogs_search_field', element)[0], panelWrap = $('.im_dialogs_panel', element)[0], searchClear = $('.im_dialogs_search_clear', element)[0], - tabsWrap = $('.im_dialogs_tabs_wrap', element)[0], searchFocused = false; @@ -663,12 +678,6 @@ angular.module('myApp.directives', ['myApp.filters']) $scope.$on('search_clear', function () { $(panelWrap).removeClass('im_dialogs_panel_search'); $scope.$broadcast('ui_dialogs_search'); - }) - - attrs.$observe('hasTabs', function (newValue) { - newValue = newValue == 'true'; - $(tabsWrap).toggle(newValue); - $scope.$broadcast('ui_dialogs_tabs', newValue); }); $(document).on('keydown', onKeyDown); @@ -828,7 +837,6 @@ angular.module('myApp.directives', ['myApp.filters']) : '.im_dialogs_panel', panelWrap = $(panelWrapSelector)[0], footer = $('.footer_wrap')[0], - hasTabs = false, moreNotified = false; onContentLoaded(function () { @@ -842,11 +850,6 @@ angular.module('myApp.directives', ['myApp.filters']) } $scope.$on('ui_dialogs_prepend', updateScroller); - - $scope.$on('ui_dialogs_tabs', function (e, newHasTabs) { - hasTabs = newHasTabs; - updateSizes(); - }); $scope.$on('ui_dialogs_search', updateSizes); $scope.$on('ui_dialogs_update', updateSizes); @@ -891,9 +894,9 @@ angular.module('myApp.directives', ['myApp.filters']) if (attrs.modal) { var height = $($window).height() - - (panelWrap ? panelWrap.offsetHeight : 58) - - (Config.Mobile ? 46 : 200); - height = Math.min(350, height); + (panelWrap ? panelWrap.offsetHeight : 49) - + (Config.Mobile ? 46 : 100); + height = Math.min(Config.Mobile ? 350 : 450, height); $(element).css({height: height}); updateScroller(); return; diff --git a/app/js/directives_mobile.js b/app/js/directives_mobile.js index 004d2014..29d6fa0c 100644 --- a/app/js/directives_mobile.js +++ b/app/js/directives_mobile.js @@ -27,13 +27,8 @@ angular.module('myApp.directives') ? '.mobile_modal_body .im_dialogs_panel' : '.im_dialogs_panel', panelWrap = $(panelWrapSelector)[0], - hasTabs = false, moreNotified = false; - $scope.$on('ui_dialogs_tabs', function (e, newHasTabs) { - hasTabs = newHasTabs; - updateSizes(); - }); $scope.$on('ui_dialogs_search', updateSizes); $scope.$on('ui_dialogs_update', updateSizes); diff --git a/app/js/lib/utils.js b/app/js/lib/utils.js index c0bafb1e..347f81d8 100644 --- a/app/js/lib/utils.js +++ b/app/js/lib/utils.js @@ -348,6 +348,7 @@ function templateUrl (tplName) { media_modal_layout: 'desktop', slider: 'desktop', reply_message: 'desktop', + forwarded_messages: 'desktop', chat_invite_link_modal: 'desktop', reply_markup: 'desktop', dialog_service: 'desktop', diff --git a/app/js/locales/en-us.json b/app/js/locales/en-us.json index 24847798..1a2c1250 100644 --- a/app/js/locales/en-us.json +++ b/app/js/locales/en-us.json @@ -441,6 +441,7 @@ "im_channel_mute": "Mute", "im_channel_unmute": "Unmute", "im_reply_loading": "Loading{dots}", + "im_X_forwarded_messages": "{'one': '{} forwarded message', 'other': '{} forwarded messages'}", "im_photos_drop_text": "Drop photos here to send", "im_message_field_placeholder": "Write a message...", "im_broadcast_field_placeholder": "Broadcast a message...", diff --git a/app/js/messages_manager.js b/app/js/messages_manager.js index 655b4868..4433a1cd 100644 --- a/app/js/messages_manager.js +++ b/app/js/messages_manager.js @@ -415,6 +415,9 @@ angular.module('myApp.services') } function getMessageLocalID (fullMsgID) { + if (!fullMsgID) { + return 0; + } return fullMsgID % fullMsgIDModulus; } @@ -1065,119 +1068,118 @@ angular.module('myApp.services') historyStorage = historiesStorage[peerID] = {count: null, history: [], pending: []}; } - MtpApiManager.getUserID().then(function (fromID) { - if (peerID != fromID) { - flags |= 2; - if (!isChannel && !AppUsersManager.isBot(peerID)) { - flags |= 1; + var fromID = AppUsersManager.getSelf().id; + if (peerID != fromID) { + flags |= 2; + if (!isChannel && !AppUsersManager.isBot(peerID)) { + flags |= 1; + } + } + if (replyToMsgID) { + flags |= 8; + } + if (asChannel) { + fromID = 0; + } else { + flags |= 256; + } + message = { + _: 'message', + id: messageID, + from_id: fromID, + to_id: AppPeersManager.getOutputPeer(peerID), + flags: flags, + date: tsNow(true) + serverTimeOffset, + message: text, + random_id: randomIDS, + reply_to_msg_id: replyToMsgID, + entities: entities, + pending: true + }; + + var toggleError = function (on) { + var historyMessage = messagesForHistory[messageID]; + if (on) { + message.error = true; + if (historyMessage) { + historyMessage.error = true; + } + } else { + delete message.error; + if (historyMessage) { + delete historyMessage.error; } } + $rootScope.$broadcast('messages_pending'); + } + + message.send = function () { + toggleError(false); + var sentRequestOptions = {}; + if (pendingAfterMsgs[peerID]) { + sentRequestOptions.afterMessageID = pendingAfterMsgs[peerID].messageID; + } + var flags = 0; if (replyToMsgID) { + flags |= 1; + } + if (entities.length) { flags |= 8; } if (asChannel) { - fromID = 0; - } else { - flags |= 256; + flags |= 16; } - message = { - _: 'message', - id: messageID, - from_id: fromID, - to_id: AppPeersManager.getOutputPeer(peerID), + // console.log(flags, entities); + MtpApiManager.invokeApi('messages.sendMessage', { flags: flags, - date: tsNow(true) + serverTimeOffset, + peer: inputPeer, message: text, - random_id: randomIDS, - reply_to_msg_id: replyToMsgID, - entities: entities, - pending: true - }; - - var toggleError = function (on) { - var historyMessage = messagesForHistory[messageID]; - if (on) { - message.error = true; - if (historyMessage) { - historyMessage.error = true; - } - } else { - delete message.error; - if (historyMessage) { - delete historyMessage.error; - } + random_id: randomID, + reply_to_msg_id: getMessageLocalID(replyToMsgID), + entities: entities + }, sentRequestOptions).then(function (updates) { + if (updates._ == 'updateShortSentMessage') { + message.flags = updates.flags; + message.date = updates.date; + message.id = updates.id; + message.media = updates.media; + message.entities = updates.entities; + updates = { + _: 'updates', + users: [], + chats: [], + seq: 0, + updates: [{ + _: 'updateMessageID', + random_id: randomIDS, + id: updates.id + }, { + _: isChannel ? 'updateNewChannelMessage' : 'updateNewMessage', + message: message, + pts: updates.pts, + pts_count: updates.pts_count + }] + }; } - $rootScope.$broadcast('messages_pending'); - } - - message.send = function () { - toggleError(false); - var sentRequestOptions = {}; - if (pendingAfterMsgs[peerID]) { - sentRequestOptions.afterMessageID = pendingAfterMsgs[peerID].messageID; + ApiUpdatesManager.processUpdateMessage(updates); + }, function (error) { + toggleError(true); + })['finally'](function () { + if (pendingAfterMsgs[peerID] === sentRequestOptions) { + delete pendingAfterMsgs[peerID]; } - var flags = 0; - if (replyToMsgID) { - flags |= 1; - } - if (entities.length) { - flags |= 8; - } - if (asChannel) { - flags |= 16; - } - // console.log(flags, entities); - MtpApiManager.invokeApi('messages.sendMessage', { - flags: flags, - peer: inputPeer, - message: text, - random_id: randomID, - reply_to_msg_id: getMessageLocalID(replyToMsgID), - entities: entities - }, sentRequestOptions).then(function (updates) { - if (updates._ == 'updateShortSentMessage') { - message.flags = updates.flags; - message.date = updates.date; - message.id = updates.id; - message.media = updates.media; - message.entities = updates.entities; - updates = { - _: 'updates', - users: [], - chats: [], - seq: 0, - updates: [{ - _: 'updateMessageID', - random_id: randomIDS, - id: updates.id - }, { - _: isChannel ? 'updateNewChannelMessage' : 'updateNewMessage', - message: message, - pts: updates.pts, - pts_count: updates.pts_count - }] - }; - } - ApiUpdatesManager.processUpdateMessage(updates); - }, function (error) { - toggleError(true); - })['finally'](function () { - if (pendingAfterMsgs[peerID] === sentRequestOptions) { - delete pendingAfterMsgs[peerID]; - } - }); + }); - pendingAfterMsgs[peerID] = sentRequestOptions; - }; + pendingAfterMsgs[peerID] = sentRequestOptions; + }; - saveMessages([message]); - historyStorage.pending.unshift(messageID); - $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); + saveMessages([message]); + historyStorage.pending.unshift(messageID); + $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); - // setTimeout(function () { - message.send(); - // }, 5000); - }); + // setTimeout(function () { + message.send(); + // }, 5000); pendingByRandomID[randomIDS] = [peerID, messageID]; }; @@ -1216,151 +1218,150 @@ angular.module('myApp.services') historyStorage = historiesStorage[peerID] = {count: null, history: [], pending: []}; } - MtpApiManager.getUserID().then(function (fromID) { - if (peerID != fromID) { - flags |= 2; - if (!isChannel && !AppUsersManager.isBot(peerID)) { - flags |= 1; + var fromID = AppUsersManager.getSelf().id; + if (peerID != fromID) { + flags |= 2; + if (!isChannel && !AppUsersManager.isBot(peerID)) { + flags |= 1; + } + } + if (replyToMsgID) { + flags |= 8; + } + if (asChannel) { + fromID = 0; + } else { + flags |= 256; + } + var media = { + _: 'messageMediaPending', + type: attachType, + file_name: file.name || apiFileName, + size: file.size, + progress: {percent: 1, total: file.size} + }; + + var message = { + _: 'message', + id: messageID, + from_id: fromID, + to_id: AppPeersManager.getOutputPeer(peerID), + flags: flags, + date: tsNow(true) + serverTimeOffset, + message: '', + media: media, + random_id: randomIDS, + reply_to_msg_id: replyToMsgID, + pending: true + }; + + var toggleError = function (on) { + var historyMessage = messagesForHistory[messageID]; + if (on) { + message.error = true; + if (historyMessage) { + historyMessage.error = true; } - } - if (replyToMsgID) { - flags |= 8; - } - if (asChannel) { - fromID = 0; } else { - flags |= 256; - } - var media = { - _: 'messageMediaPending', - type: attachType, - file_name: file.name || apiFileName, - size: file.size, - progress: {percent: 1, total: file.size} - }; - - var message = { - _: 'message', - id: messageID, - from_id: fromID, - to_id: AppPeersManager.getOutputPeer(peerID), - flags: flags, - date: tsNow(true) + serverTimeOffset, - message: '', - media: media, - random_id: randomIDS, - reply_to_msg_id: replyToMsgID, - pending: true - }; - - var toggleError = function (on) { - var historyMessage = messagesForHistory[messageID]; - if (on) { - message.error = true; - if (historyMessage) { - historyMessage.error = true; - } - } else { - delete message.error; - if (historyMessage) { - delete historyMessage.error; - } + delete message.error; + if (historyMessage) { + delete historyMessage.error; } - $rootScope.$broadcast('messages_pending'); } + $rootScope.$broadcast('messages_pending'); + } - var uploaded = false, - uploadPromise; + var uploaded = false, + uploadPromise; - message.send = function () { - var sendFileDeferred = $q.defer(); + message.send = function () { + var sendFileDeferred = $q.defer(); - sendFilePromise.then(function () { - if (!uploaded || message.error) { - uploaded = false; - uploadPromise = MtpApiFileManager.uploadFile(file); + sendFilePromise.then(function () { + if (!uploaded || message.error) { + uploaded = false; + uploadPromise = MtpApiFileManager.uploadFile(file); + } + + uploadPromise.then(function (inputFile) { + inputFile.name = apiFileName; + uploaded = true; + var inputMedia; + switch (attachType) { + case 'photo': + inputMedia = {_: 'inputMediaUploadedPhoto', file: inputFile}; + break; + + case 'video': + inputMedia = {_: 'inputMediaUploadedVideo', file: inputFile, duration: 0, w: 0, h: 0, mime_type: file.type}; + break; + + case 'audio': + inputMedia = {_: 'inputMediaUploadedAudio', file: inputFile, duration: 0, mime_type: file.type}; + break; + + case 'document': + default: + inputMedia = {_: 'inputMediaUploadedDocument', file: inputFile, mime_type: file.type, attributes: [ + {_: 'documentAttributeFilename', file_name: file.name} + ]}; } - - uploadPromise.then(function (inputFile) { - inputFile.name = apiFileName; - uploaded = true; - var inputMedia; - switch (attachType) { - case 'photo': - inputMedia = {_: 'inputMediaUploadedPhoto', file: inputFile}; - break; - - case 'video': - inputMedia = {_: 'inputMediaUploadedVideo', file: inputFile, duration: 0, w: 0, h: 0, mime_type: file.type}; - break; - - case 'audio': - inputMedia = {_: 'inputMediaUploadedAudio', file: inputFile, duration: 0, mime_type: file.type}; - break; - - case 'document': - default: - inputMedia = {_: 'inputMediaUploadedDocument', file: inputFile, mime_type: file.type, attributes: [ - {_: 'documentAttributeFilename', file_name: file.name} - ]}; - } - var flags = 0; - if (replyToMsgID) { - flags |= 1; - } - if (asChannel) { - flags |= 16; - } - MtpApiManager.invokeApi('messages.sendMedia', { - flags: flags, - peer: inputPeer, - media: inputMedia, - random_id: randomID, - reply_to_msg_id: getMessageLocalID(replyToMsgID) - }).then(function (updates) { - ApiUpdatesManager.processUpdateMessage(updates); - }, function (error) { - if (attachType == 'photo' && - error.code == 400 && - error.type == 'PHOTO_INVALID_DIMENSIONS') { - error.handled = true; - attachType = 'document'; - message.send(); - return; - } - toggleError(true); - }); + var flags = 0; + if (replyToMsgID) { + flags |= 1; + } + if (asChannel) { + flags |= 16; + } + MtpApiManager.invokeApi('messages.sendMedia', { + flags: flags, + peer: inputPeer, + media: inputMedia, + random_id: randomID, + reply_to_msg_id: getMessageLocalID(replyToMsgID) + }).then(function (updates) { + ApiUpdatesManager.processUpdateMessage(updates); }, function (error) { - toggleError(true); - }, function (progress) { - // console.log('upload progress', progress); - media.progress.done = progress.done; - media.progress.percent = Math.max(1, Math.floor(100 * progress.done / progress.total)); - $rootScope.$broadcast('history_update', {peerID: peerID}); - }); - - media.progress.cancel = function () { - if (!uploaded) { - sendFileDeferred.resolve(); - uploadPromise.cancel(); - cancelPendingMessage(randomIDS); + if (attachType == 'photo' && + error.code == 400 && + error.type == 'PHOTO_INVALID_DIMENSIONS') { + error.handled = true; + attachType = 'document'; + message.send(); + return; } - } - - uploadPromise['finally'](function () { - sendFileDeferred.resolve(); + toggleError(true); }); + }, function (error) { + toggleError(true); + }, function (progress) { + // console.log('upload progress', progress); + media.progress.done = progress.done; + media.progress.percent = Math.max(1, Math.floor(100 * progress.done / progress.total)); + $rootScope.$broadcast('history_update', {peerID: peerID}); }); - sendFilePromise = sendFileDeferred.promise; - }; + media.progress.cancel = function () { + if (!uploaded) { + sendFileDeferred.resolve(); + uploadPromise.cancel(); + cancelPendingMessage(randomIDS); + } + } - saveMessages([message]); - historyStorage.pending.unshift(messageID); - $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); + uploadPromise['finally'](function () { + sendFileDeferred.resolve(); + }); + }); - message.send(); - }); + sendFilePromise = sendFileDeferred.promise; + }; + + saveMessages([message]); + historyStorage.pending.unshift(messageID); + $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); + + message.send(); pendingByRandomID[randomIDS] = [peerID, messageID]; } @@ -1381,106 +1382,115 @@ angular.module('myApp.services') historyStorage = historiesStorage[peerID] = {count: null, history: [], pending: []}; } - MtpApiManager.getUserID().then(function (fromID) { - var media; - switch (inputMedia._) { - case 'inputMediaContact': - media = angular.extend({}, inputMedia, {_: 'messageMediaContact'}); - break; + var fromID = AppUsersManager.getSelf().id; + var media; + switch (inputMedia._) { + case 'inputMediaContact': + media = angular.extend({}, inputMedia, {_: 'messageMediaContact'}); + break; - case 'inputMediaPhoto': - media = { - _: 'messageMediaPhoto', - photo: AppPhotosManager.getPhoto(inputMedia.id.id) - }; - break; + case 'inputMediaPhoto': + media = { + _: 'messageMediaPhoto', + photo: AppPhotosManager.getPhoto(inputMedia.id.id) + }; + break; - case 'inputMediaDocument': - var doc = AppDocsManager.getDoc(inputMedia.id.id); - if (doc.sticker && doc.stickerSetInput) { - AppStickersManager.pushPopularSticker(doc.id); - }; - media = { - _: 'messageMediaDocument', - 'document': doc - }; - break; + case 'inputMediaDocument': + var doc = AppDocsManager.getDoc(inputMedia.id.id); + if (doc.sticker && doc.stickerSetInput) { + AppStickersManager.pushPopularSticker(doc.id); + }; + media = { + _: 'messageMediaDocument', + 'document': doc + }; + break; + } + + var flags = 0; + if (peerID != fromID) { + flags |= 2; + if (!AppUsersManager.isBot(peerID)) { + flags |= 1; } + } + if (replyToMsgID) { + flags |= 8; + } + if (asChannel) { + fromID = 0; + } else { + flags |= 256; + } - var flags = 0; - if (peerID != fromID) { - flags |= 2; - if (!AppUsersManager.isBot(peerID)) { - flags |= 1; + var message = { + _: 'message', + id: messageID, + from_id: fromID, + to_id: AppPeersManager.getOutputPeer(peerID), + flags: flags, + date: tsNow(true) + serverTimeOffset, + message: '', + media: media, + random_id: randomIDS, + reply_to_msg_id: replyToMsgID, + pending: true + }; + + var toggleError = function (on) { + var historyMessage = messagesForHistory[messageID]; + if (on) { + message.error = true; + if (historyMessage) { + historyMessage.error = true; + } + } else { + delete message.error; + if (historyMessage) { + delete historyMessage.error; } } + $rootScope.$broadcast('messages_pending'); + } + + message.send = function () { + var flags = 0; if (replyToMsgID) { - flags |= 8; + flags |= 1; } if (asChannel) { - fromID = 0; - } else { - flags |= 256; + flags |= 16; } - var message = { - _: 'message', - id: messageID, - from_id: fromID, - to_id: AppPeersManager.getOutputPeer(peerID), + var sentRequestOptions = {}; + if (pendingAfterMsgs[peerID]) { + sentRequestOptions.afterMessageID = pendingAfterMsgs[peerID].messageID; + } + + MtpApiManager.invokeApi('messages.sendMedia', { flags: flags, - date: tsNow(true) + serverTimeOffset, - message: '', - media: media, - random_id: randomIDS, - reply_to_msg_id: replyToMsgID, - pending: true - }; - - var toggleError = function (on) { - var historyMessage = messagesForHistory[messageID]; - if (on) { - message.error = true; - if (historyMessage) { - historyMessage.error = true; - } - } else { - delete message.error; - if (historyMessage) { - delete historyMessage.error; - } + peer: inputPeer, + media: inputMedia, + random_id: randomID, + reply_to_msg_id: getMessageLocalID(replyToMsgID) + }, sentRequestOptions).then(function (updates) { + ApiUpdatesManager.processUpdateMessage(updates); + }, function (error) { + toggleError(true); + })['finally'](function () { + if (pendingAfterMsgs[peerID] === sentRequestOptions) { + delete pendingAfterMsgs[peerID]; } - $rootScope.$broadcast('messages_pending'); - } + }); + pendingAfterMsgs[peerID] = sentRequestOptions; + }; - message.send = function () { - var flags = 0; - if (replyToMsgID) { - flags |= 1; - } - if (asChannel) { - flags |= 16; - } - MtpApiManager.invokeApi('messages.sendMedia', { - flags: flags, - peer: inputPeer, - media: inputMedia, - random_id: randomID, - reply_to_msg_id: getMessageLocalID(replyToMsgID) - }).then(function (updates) { - ApiUpdatesManager.processUpdateMessage(updates); - }, function (error) { - toggleError(true); - }); - }; - - saveMessages([message]); - historyStorage.pending.unshift(messageID); - $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); - - message.send(); - }); + saveMessages([message]); + historyStorage.pending.unshift(messageID); + $rootScope.$broadcast('history_append', {peerID: peerID, messageID: messageID, my: true}); + message.send(); pendingByRandomID[randomIDS] = [peerID, messageID]; } @@ -1509,7 +1519,12 @@ angular.module('myApp.services') to_peer: AppPeersManager.getInputPeerByID(peerID), }, sentRequestOptions).then(function (updates) { ApiUpdatesManager.processUpdateMessage(updates); + })['finally'](function () { + if (pendingAfterMsgs[peerID] === sentRequestOptions) { + delete pendingAfterMsgs[peerID]; + } }); + pendingAfterMsgs[peerID] = sentRequestOptions; }; function startBot (botID, chatID, startParam) { @@ -1996,6 +2011,47 @@ angular.module('myApp.services') return wasUpdated; } + function getMessageThumb (message, thumbWidth, thumbHeight) { + var thumbPhotoSize; + var sticker = false; + if (message.media) { + switch (message.media._) { + case 'messageMediaPhoto': + thumbPhotoSize = AppPhotosManager.choosePhotoSize(message.media.photo, thumbWidth, thumbHeight); + break; + + case 'messageMediaDocument': + thumbPhotoSize = message.media.document.thumb; + if (message.media.document.sticker) { + sticker = true; + } + break; + + case 'messageMediaVideo': + thumbPhotoSize = message.media.video.thumb; + break; + } + } + + if (thumbPhotoSize && thumbPhotoSize._ != 'photoSizeEmpty') { + var dim = calcImageInBox(thumbPhotoSize.w, thumbPhotoSize.h, thumbWidth, thumbHeight, true); + + var thumb = { + width: dim.w, + height: dim.h, + location: thumbPhotoSize.location, + size: thumbPhotoSize.size + }; + if (sticker) { + thumb.location.sticker = true; + } + + return thumb; + } + + return false; + } + function incrementMaxSeenID (maxID) { if (maxSeenID !== false && maxID && maxID > maxSeenID) { Storage.set({ @@ -2602,6 +2658,7 @@ angular.module('myApp.services') startBot: startBot, openChatInviteLink: openChatInviteLink, getMessagePeer: getMessagePeer, + getMessageThumb: getMessageThumb, wrapForDialog: wrapForDialog, wrapForHistory: wrapForHistory, wrapReplyMarkup: wrapReplyMarkup, diff --git a/app/js/services.js b/app/js/services.js index 6857ab50..8ce6dde0 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -3794,7 +3794,14 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) }).then(function (toPeerString) { var url = decodeURIComponent(matches[1]); var text = matches[2] ? decodeURIComponent(matches[2]) : ''; - $rootScope.$broadcast('history_focus', {peerString: toPeerString, shareUrl: url, shareText: text}); + $rootScope.$broadcast('history_focus', { + peerString: toPeerString, + attachment: { + _: 'share_url', + url: url, + text: text + } + }); }); return true; } diff --git a/app/less/app.less b/app/less/app.less index 5f516392..2fb4a08a 100644 --- a/app/less/app.less +++ b/app/less/app.less @@ -1055,8 +1055,13 @@ a.tg_radio_on:hover i.icon-radio { margin-top: 10px; } .im_dialogs_panel { - padding: 12px 12px 6px; + padding: 12px 12px 12px; position: relative; + .im_dialogs_modal_col_wrap & { + padding: 7px 12px 6px; + .box-shadow(0px 1px 1px rgba(0,0,0,0.15)); + z-index: 1; + } } .im_dialogs_search { position: relative; @@ -1068,7 +1073,7 @@ a.tg_radio_on:hover i.icon-radio { border: 1px solid #F2F2F2; border-radius: 2px; padding: 6px 20px 6px 30px; - margin: 0 0 6px; + margin: 0 0 0; background-color: #F2F2F2; .image-2x('../img/icons/IconsetW.png', 42px, 1171px); @@ -1076,7 +1081,7 @@ a.tg_radio_on:hover i.icon-radio { .im_dialogs_modal_col_wrap & { background-color: #fff; - border-color: #d9dbde; + border-color: #fff !important; } &:focus, @@ -1092,14 +1097,13 @@ a.tg_radio_on:hover i.icon-radio { a.tg_search_clear { position: absolute; right: 0; - margin-top: -40px; + margin-top: -34px; width: 34px; height: 34px; opacity: 0.6; .contacts_modal_search & { right: 12px; - margin-top: -34px; } &:hover { @@ -1135,56 +1139,6 @@ i.icon-verified { } -.im_dialogs_tabs_wrap { - display: none; -} -.im_dialogs_tabs { - padding: 4px 0; - position: relative; -} - -.im_dialogs_tab { - color: #8c8c8c; - background: #f2f2f2; - height: 30px; - text-align: center; - overflow: hidden; - width: 50%; - float: left; - padding: 7px 0; - - &:hover, - &:active, - &:focus { - color: #8c8c8c; - text-decoration: none; - } - - &.active { - color: #fff; - background: #6490b1; - } - - &:first-child { - border-radius: 2px 0 0 2px; - } - - &:last-child { - border-radius: 0 2px 2px 0; - } -} - -.im_dialogs_panel_dropdown { - position: absolute; - right: 12px; - - .dropdown-menu { - right: auto; - left: 0; - margin-top: 8px; - } -} - .im_dialogs_scrollable_wrap { outline: none ! important; @@ -1224,6 +1178,10 @@ i.icon-verified { } } +.im_dialogs_modal_list { + padding-top: 10px; +} + .im_dialog_message_wrap { overflow: hidden; word-wrap: break-word; @@ -3089,14 +3047,16 @@ _:-ms-lang(x), .composer_rich_textarea:empty:focus:before { /* Contacts modal */ .contacts_modal_search { - padding: 0 0 14px; position: relative; + padding: 7px 12px 6px; + .box-shadow(0px 1px 1px rgba(0,0,0,0.15)); + z-index: 1; } .contacts_modal_search_field { font-size: 12px; line-height: normal; - border: 1px solid #d9dbde; + border: 1px solid #fff !important; border-radius: 2px; padding: 6px 15px 6px 30px; margin: 0; @@ -3130,6 +3090,7 @@ a.contacts_modal_search_clear { } .contacts_modal_members_list { + .contacts_modal_contact_wrap { margin-top: 0; } @@ -3395,9 +3356,12 @@ a.contacts_modal_contact:hover .md_modal_list_peer_description, } .im_message_outer_wrap { - background-color: rgba(242, 246, 250, 1.0); + // background-color: rgba(242, 246, 250, 1.0); + background-color: rgba(242, 246, 250, 0); animation-name: im_message_focus_fade; - animation-duration: 5s; + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-out; + animation-duration: 4s; } } @@ -4088,7 +4052,7 @@ a.countries_modal_search_clear { padding: 15px 27px 15px; } .md_modal_footer_empty { - padding: 15px 27px 0; + padding: 10px 27px 0; } .md_photo_loading { diff --git a/app/less/desktop.less b/app/less/desktop.less index 766dc106..1027a1d8 100644 --- a/app/less/desktop.less +++ b/app/less/desktop.less @@ -622,10 +622,6 @@ a.footer_link.active:active { -webkit-transform: translateZ(0); -webkit-perspective: 1000; -webkit-backface-visibility: hidden; - - .im_dialogs_modal_col_wrap & { - padding: 0; - } } .im_dialogs_col { @@ -680,6 +676,7 @@ a.footer_link.active:active { .contacts_modal_col .nano > & { width: 5px; right: 4px; + top: 10px; } .sessions_modal_col .nano > &, @@ -693,6 +690,7 @@ a.footer_link.active:active { .im_dialogs_modal_col .nano > & { width: 6px; right: 2px; + top: 10px; } .im_history_col .nano > & { @@ -777,12 +775,9 @@ a.footer_link.active:active { } } - &_search { - padding: 15px 12px 12px; - position: relative; - } - &_members_list { + padding-top: 10px; + a.contacts_modal_contact { padding: 8px 16px; } @@ -1020,9 +1015,6 @@ a.footer_link.active:active { .modal-dialog { max-width: 420px; } - .im_dialogs_panel { - padding-top: 15px; - } } &_modal_footer { diff --git a/app/less/mobile.less b/app/less/mobile.less index d10b409d..d40a8ca6 100644 --- a/app/less/mobile.less +++ b/app/less/mobile.less @@ -1512,7 +1512,7 @@ img.composer_user_photo { .contacts_modal { &_search { - padding: 3px 0 12px; + margin: -9px -9px 0; } &_col { diff --git a/app/partials/desktop/forwarded_messages.html b/app/partials/desktop/forwarded_messages.html new file mode 100644 index 00000000..486ea46b --- /dev/null +++ b/app/partials/desktop/forwarded_messages.html @@ -0,0 +1,45 @@ +
+
+
+ +
+
+ +
+
+
+ + + + + + + + () + + + + + + + + + + + + +
+
+ + + + +
+
+
\ No newline at end of file diff --git a/app/partials/desktop/im.html b/app/partials/desktop/im.html index ff0b5c46..c2707912 100644 --- a/app/partials/desktop/im.html +++ b/app/partials/desktop/im.html @@ -4,7 +4,7 @@
-
+
+
+ +
+
+
diff --git a/app/partials/desktop/peer_select.html b/app/partials/desktop/peer_select.html index 2ca1a5b1..bd1d1bdb 100644 --- a/app/partials/desktop/peer_select.html +++ b/app/partials/desktop/peer_select.html @@ -23,7 +23,7 @@
-
-