Browse Source

Fixed reply to message in message form

master
Igor Zhukov 9 years ago
parent
commit
471e3b3114
  1. 23
      app/js/controllers.js
  2. 6
      app/partials/desktop/im.html
  3. 4
      app/partials/mobile/im.html

23
app/js/controllers.js

@ -2241,7 +2241,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
text = RichTextProcessor.parseEmojis(text) text = RichTextProcessor.parseEmojis(text)
var options = { var options = {
replyToMsgID: $scope.draftMessage.replyToMessage && $scope.draftMessage.replyToMessage.mid, replyToMsgID: $scope.draftMessage.replyToMsgID,
clearDraft: true clearDraft: true
} }
do { do {
@ -2462,7 +2462,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
function replySelect (messageID, byUser) { function replySelect (messageID, byUser) {
$scope.draftMessage.replyToMessage = AppMessagesManager.wrapSingleMessage(messageID) $scope.draftMessage.replyToMsgID = messageID
$scope.$broadcast('ui_peer_reply') $scope.$broadcast('ui_peer_reply')
replyToMarkup = false replyToMarkup = false
@ -2475,15 +2475,15 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
function replyClear (byUser) { function replyClear (byUser) {
var message = $scope.draftMessage.replyToMessage var mid = $scope.draftMessage.replyToMsgID
if (message && if (mid &&
$scope.historyState.replyKeyboard && $scope.historyState.replyKeyboard &&
$scope.historyState.replyKeyboard.mid == message.mid && $scope.historyState.replyKeyboard.mid == mid &&
!$scope.historyState.replyKeyboard.pFlags.hidden) { !$scope.historyState.replyKeyboard.pFlags.hidden) {
$scope.historyState.replyKeyboard.pFlags.hidden = true $scope.historyState.replyKeyboard.pFlags.hidden = true
$scope.$broadcast('ui_keyboard_update') $scope.$broadcast('ui_keyboard_update')
} }
delete $scope.draftMessage.replyToMessage delete $scope.draftMessage.replyToMsgID
$scope.$broadcast('ui_peer_reply') $scope.$broadcast('ui_peer_reply')
if (byUser) { if (byUser) {
@ -2575,10 +2575,9 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
} }
if ($scope.curDialog.peerID) { if ($scope.curDialog.peerID) {
var replyToMessage = $scope.draftMessage.replyToMessage
DraftsManager.changeDraft($scope.curDialog.peerID, { DraftsManager.changeDraft($scope.curDialog.peerID, {
text: newVal, text: newVal,
replyToMsgID: replyToMessage && replyToMessage.mid replyToMsgID: $scope.draftMessage.replyToMsgID
}) })
checkInlinePattern(newVal) checkInlinePattern(newVal)
} }
@ -2664,11 +2663,11 @@ angular.module('myApp.controllers', ['myApp.i18n'])
return return
} }
var options = { var options = {
replyToMsgID: $scope.draftMessage.replyToMessage && $scope.draftMessage.replyToMessage.mid, replyToMsgID: $scope.draftMessage.replyToMsgID,
isMedia: $scope.draftMessage.isMedia isMedia: $scope.draftMessage.isMedia
} }
delete $scope.draftMessage.replyToMessage delete $scope.draftMessage.replyToMsgID
if (newVal[0].lastModified) { if (newVal[0].lastModified) {
newVal.sort(function (file1, file2) { newVal.sort(function (file1, file2) {
@ -2699,7 +2698,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
} }
var options = { var options = {
replyToMsgID: $scope.draftMessage.replyToMessage && $scope.draftMessage.replyToMessage.mid replyToMsgID: $scope.draftMessage.replyToMsgID
} }
AppMessagesManager.sendOther($scope.curDialog.peerID, inputMedia, options) AppMessagesManager.sendOther($scope.curDialog.peerID, inputMedia, options)
$scope.$broadcast('ui_message_send') $scope.$broadcast('ui_message_send')
@ -2736,7 +2735,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
var options = { var options = {
replyToMsgID: $scope.draftMessage.replyToMessage && $scope.draftMessage.replyToMessage.mid replyToMsgID: $scope.draftMessage.replyToMsgID
} }
AppInlineBotsManager.sendInlineResult($scope.curDialog.peerID, qID, options) AppInlineBotsManager.sendInlineResult($scope.curDialog.peerID, qID, options)
fwdsSend() fwdsSend()

6
app/partials/desktop/im.html

@ -176,7 +176,7 @@
<div class="im_send_form_wrap1"> <div class="im_send_form_wrap1">
<div class="im_send_form_wrap clearfix" ng-controller="AppImSendController" ng-class="{im_send_reply_form_wrap: draftMessage.replyToMessage != null}"> <div class="im_send_form_wrap clearfix" ng-controller="AppImSendController" ng-class="{im_send_reply_form_wrap: draftMessage.replyToMsgID > 0}">
<a class="pull-right im_panel_peer_photo" my-peer-photolink="historyPeer.id" img-class="im_panel_peer_photo" watch="true" ng-show="!draftMessage.isBroadcast"> <a class="pull-right im_panel_peer_photo" my-peer-photolink="historyPeer.id" img-class="im_panel_peer_photo" watch="true" ng-show="!draftMessage.isBroadcast">
<i class="icon im_panel_peer_online" ng-show="historyPeer.id > 0 &amp;&amp; historyPeer.data.status._ == 'userStatusOnline'"></i> <i class="icon im_panel_peer_online" ng-show="historyPeer.id > 0 &amp;&amp; historyPeer.data.status._ == 'userStatusOnline'"></i>
@ -187,9 +187,9 @@
<div class="im_send_form_inline_results" my-inline-results="inlineResults"></div> <div class="im_send_form_inline_results" my-inline-results="inlineResults"></div>
<div class="im_send_reply_wrap" ng-if="draftMessage.replyToMessage != null"> <div class="im_send_reply_wrap" ng-if="draftMessage.replyToMsgID > 0">
<a class="im_send_reply_cancel" ng-mousedown="draftMessage.replyClear(true)"><i class="icon icon-reply-bar"></i><i class="icon icon-reply-bar"></i></a> <a class="im_send_reply_cancel" ng-mousedown="draftMessage.replyClear(true)"><i class="icon icon-reply-bar"></i><i class="icon icon-reply-bar"></i></a>
<a class="im_message_reply_wrap" my-reply-message="draftMessage.replyToMessage" watch="true"></a> <a class="im_message_reply_wrap" my-reply-message="draftMessage.replyToMsgID" watch="true"></a>
</div> </div>
<div class="im_send_reply_wrap im_send_fwds_wrap" ng-if="draftMessage.fwdMessages.length > 0"> <div class="im_send_reply_wrap im_send_fwds_wrap" ng-if="draftMessage.fwdMessages.length > 0">

4
app/partials/mobile/im.html

@ -138,9 +138,9 @@
<div class="im_send_form_wrap clearfix" ng-controller="AppImSendController"> <div class="im_send_form_wrap clearfix" ng-controller="AppImSendController">
<form my-send-form draft-message="draftMessage" mentions="mentions" commands="commands" class="im_send_form" ng-class="{im_send_form_empty: !draftMessage.text.length, composer_progress_enabled: draftMessage.inlineProgress}"> <form my-send-form draft-message="draftMessage" mentions="mentions" commands="commands" class="im_send_form" ng-class="{im_send_form_empty: !draftMessage.text.length, composer_progress_enabled: draftMessage.inlineProgress}">
<div class="im_send_reply_wrap" ng-if="draftMessage.replyToMessage != null"> <div class="im_send_reply_wrap" ng-if="draftMessage.replyToMsgID > 0">
<a class="im_send_reply_cancel" ng-mousedown="draftMessage.replyClear()"><i class="icon icon-reply-bar"></i><i class="icon icon-reply-bar"></i></a> <a class="im_send_reply_cancel" ng-mousedown="draftMessage.replyClear()"><i class="icon icon-reply-bar"></i><i class="icon icon-reply-bar"></i></a>
<a class="im_message_reply_wrap" my-reply-message="draftMessage.replyToMessage" watch="true"></a> <a class="im_message_reply_wrap" my-reply-message="draftMessage.replyToMsgID" watch="true"></a>
</div> </div>
<div class="im_send_reply_wrap im_send_fwds_wrap" ng-if="draftMessage.fwdMessages.length > 0"> <div class="im_send_reply_wrap im_send_fwds_wrap" ng-if="draftMessage.fwdMessages.length > 0">

Loading…
Cancel
Save