From f1fdd25070b60c95e965b689f7f538c845ae3464 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 1 Oct 2015 22:44:53 +0300 Subject: [PATCH] Improved mobile support --- app/js/controllers.js | 2 +- app/js/lib/utils.js | 4 +- app/js/messages_manager.js | 2 +- app/js/services.js | 5 +- app/partials/desktop/chat_modal.html | 8 +- app/partials/mobile/channel_modal.html | 140 ++++++++++++++++++ app/partials/mobile/chat_modal.html | 14 +- app/partials/mobile/dialog.html | 29 +--- app/partials/mobile/full_gif.html | 6 +- app/partials/mobile/im.html | 44 ++++-- app/partials/mobile/message.html | 25 ++-- app/partials/mobile/message_attach_venue.html | 20 +++ .../mobile/message_attach_webpage.html | 47 ++++++ app/partials/mobile/message_service.html | 3 +- 14 files changed, 278 insertions(+), 71 deletions(-) create mode 100644 app/partials/mobile/channel_modal.html create mode 100644 app/partials/mobile/message_attach_venue.html create mode 100644 app/partials/mobile/message_attach_webpage.html diff --git a/app/js/controllers.js b/app/js/controllers.js index 5c40a596..9c5db6aa 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -3299,7 +3299,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.deletePhoto = function () { $scope.photo.updating = true; - MtpApiManager.invokeApi('messages.editChatPhoto', { + MtpApiManager.invokeApi('channels.editPhoto', { channel: AppChatsManager.getChannelInput($scope.chatID), photo: {_: 'inputChatPhotoEmpty'} }).then(onChatUpdated)['finally'](function () { diff --git a/app/js/lib/utils.js b/app/js/lib/utils.js index ba2ccb76..e072cc2f 100644 --- a/app/js/lib/utils.js +++ b/app/js/lib/utils.js @@ -323,7 +323,9 @@ function templateUrl (tplName) { slider: 'desktop', reply_message: 'desktop', chat_invite_link_modal: 'desktop', - reply_markup: 'desktop' + reply_markup: 'desktop', + dialog_service: 'desktop', + channel_edit_modal: 'desktop' }; var layout = forceLayout[tplName] || (Config.Mobile ? 'mobile' : 'desktop'); return 'partials/' + layout + '/' + tplName + '.html'; diff --git a/app/js/messages_manager.js b/app/js/messages_manager.js index 01ef488d..9c5fb0fb 100644 --- a/app/js/messages_manager.js +++ b/app/js/messages_manager.js @@ -1606,7 +1606,7 @@ angular.module('myApp.services') var chatTitle; if (chatInvite._ == 'chatInviteAlready') { AppChatsManager.saveApiChat(chatInvite.chat); - if (!chatInvite.chat.left) { + if (!chatInvite.chat.pFlags.left) { return $rootScope.$broadcast('history_focus', { peerString: AppChatsManager.getChatString(chatInvite.chat.id) }); diff --git a/app/js/services.js b/app/js/services.js index 3c921af6..9e2e3508 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -1010,7 +1010,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) if (chatsFull[id] !== undefined) { var chat = AppChatsManager.getChat(id); if (chat.version == chatsFull[id].participants.version || - chat.left) { + chat.pFlags.left) { return $q.when(chatsFull[id]); } } @@ -2433,7 +2433,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) message: updateMessage.message, fwd_from_id: updateMessage.fwd_from_id, fwd_date: updateMessage.fwd_date, - reply_to_msg_id: updateMessage.reply_to_msg_id + reply_to_msg_id: updateMessage.reply_to_msg_id, + entities: updateMessage.entities }, pts: updateMessage.pts, pts_count: updateMessage.pts_count diff --git a/app/partials/desktop/chat_modal.html b/app/partials/desktop/chat_modal.html index b06143e5..454d494d 100644 --- a/app/partials/desktop/chat_modal.html +++ b/app/partials/desktop/chat_modal.html @@ -4,7 +4,7 @@
- +
@@ -43,7 +43,7 @@