|
|
@ -440,7 +440,11 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
if (peerData.peerString == $scope.curDialog.peer && |
|
|
|
if (peerData.peerString == $scope.curDialog.peer && |
|
|
|
peerData.messageID == $scope.curDialog.messageID && |
|
|
|
peerData.messageID == $scope.curDialog.messageID && |
|
|
|
!peerData.startParam) { |
|
|
|
!peerData.startParam) { |
|
|
|
$scope.$broadcast(peerData.messageID ? 'ui_history_change_scroll' : 'ui_history_focus'); |
|
|
|
if (peerData.messageID) { |
|
|
|
|
|
|
|
$scope.$broadcast('ui_history_change_scroll', true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$scope.$broadcast('ui_history_focus'); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var peerID = AppPeersManager.getPeerID(peerData.peerString); |
|
|
|
var peerID = AppPeersManager.getPeerID(peerData.peerString); |
|
|
|
var username = AppPeersManager.getPeer(peerID).username; |
|
|
|
var username = AppPeersManager.getPeer(peerID).username; |
|
|
@ -1108,7 +1112,6 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
documents: 'inputMessagesFilterDocument', |
|
|
|
documents: 'inputMessagesFilterDocument', |
|
|
|
audio: 'inputMessagesFilterVoice' |
|
|
|
audio: 'inputMessagesFilterVoice' |
|
|
|
}, |
|
|
|
}, |
|
|
|
unfocusMessagePromise, |
|
|
|
|
|
|
|
jump = 0, |
|
|
|
jump = 0, |
|
|
|
moreJump = 0, |
|
|
|
moreJump = 0, |
|
|
|
moreActive = false, |
|
|
|
moreActive = false, |
|
|
@ -1131,7 +1134,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
newDialog.messageID) { |
|
|
|
newDialog.messageID) { |
|
|
|
messageFocusHistory(); |
|
|
|
messageFocusHistory(); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (newDialog.peerID) { |
|
|
|
else if (peerID) { |
|
|
|
updateHistoryPeer(true); |
|
|
|
updateHistoryPeer(true); |
|
|
|
loadHistory(); |
|
|
|
loadHistory(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1292,15 +1295,6 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
var focusedMsgID = $scope.curDialog.messageID || 0; |
|
|
|
var focusedMsgID = $scope.curDialog.messageID || 0; |
|
|
|
$scope.$broadcast('messages_focus', focusedMsgID); |
|
|
|
$scope.$broadcast('messages_focus', focusedMsgID); |
|
|
|
$scope.$broadcast('ui_history_change_scroll', true); |
|
|
|
$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 { |
|
|
|
} else { |
|
|
|
loadHistory(); |
|
|
|
loadHistory(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1442,10 +1436,10 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.state.mayBeHasMore = true; |
|
|
|
$scope.state.mayBeHasMore = true; |
|
|
|
// console.log(dT(), 'start load history', $scope.curDialog);
|
|
|
|
console.log(dT(), 'start load history', $scope.curDialog); |
|
|
|
getMessagesPromise.then(function (historyResult) { |
|
|
|
getMessagesPromise.then(function (historyResult) { |
|
|
|
if (curJump != jump) return; |
|
|
|
if (curJump != jump) return; |
|
|
|
// console.log(dT(), 'history loaded', angular.copy(historyResult));
|
|
|
|
console.log(dT(), 'history loaded', angular.copy(historyResult)); |
|
|
|
|
|
|
|
|
|
|
|
var fetchedLength = historyResult.history.length; |
|
|
|
var fetchedLength = historyResult.history.length; |
|
|
|
|
|
|
|
|
|
|
@ -1494,15 +1488,6 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
}); |
|
|
|
}); |
|
|
|
$scope.$broadcast('ui_history_change'); |
|
|
|
$scope.$broadcast('ui_history_change'); |
|
|
|
|
|
|
|
|
|
|
|
$timeout.cancel(unfocusMessagePromise); |
|
|
|
|
|
|
|
if (focusedMsgID) { |
|
|
|
|
|
|
|
unfocusMessagePromise = $timeout(function () { |
|
|
|
|
|
|
|
if ($scope.curDialog.messageID == focusedMsgID) { |
|
|
|
|
|
|
|
$scope.$broadcast('messages_focus', 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, 2800); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$rootScope.idle.isIDLE) { |
|
|
|
if (!$rootScope.idle.isIDLE) { |
|
|
|
AppMessagesManager.readHistory($scope.curDialog.peerID); |
|
|
|
AppMessagesManager.readHistory($scope.curDialog.peerID); |
|
|
|
} |
|
|
|
} |
|
|
|