|
|
@ -826,7 +826,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
if (searchMessages) { |
|
|
|
if (searchMessages) { |
|
|
|
searchTimeoutPromise = (force || maxID) ? $q.when() : $timeout(angular.noop, 500); |
|
|
|
searchTimeoutPromise = (force || maxID) ? $q.when() : $timeout(angular.noop, 500); |
|
|
|
return searchTimeoutPromise.then(function () { |
|
|
|
return searchTimeoutPromise.then(function () { |
|
|
|
return AppMessagesManager.getSearch({_: 'inputPeerEmpty'}, $scope.search.query, {_: 'inputMessagesFilterEmpty'}, maxID).then(function (result) { |
|
|
|
return AppMessagesManager.getSearch(false, $scope.search.query, {_: 'inputMessagesFilterEmpty'}, maxID).then(function (result) { |
|
|
|
if (curJump != jump) { |
|
|
|
if (curJump != jump) { |
|
|
|
return $q.reject(); |
|
|
|
return $q.reject(); |
|
|
|
} |
|
|
|
} |
|
|
@ -2614,7 +2614,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AppMessagesManager.getSearch(inputPeer, inputQuery, inputFilter, 0, 1000).then(function (searchCachedResult) { |
|
|
|
AppMessagesManager.getSearch(peerID, inputQuery, inputFilter, 0, 1000).then(function (searchCachedResult) { |
|
|
|
if (searchCachedResult.history.indexOf($scope.messageID) >= 0) { |
|
|
|
if (searchCachedResult.history.indexOf($scope.messageID) >= 0) { |
|
|
|
list = searchCachedResult.history; |
|
|
|
list = searchCachedResult.history; |
|
|
|
maxID = list[list.length - 1]; |
|
|
|
maxID = list[list.length - 1]; |
|
|
@ -2666,7 +2666,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
function loadMore () { |
|
|
|
function loadMore () { |
|
|
|
if (loadingPromise) return loadingPromise; |
|
|
|
if (loadingPromise) return loadingPromise; |
|
|
|
|
|
|
|
|
|
|
|
return loadingPromise = AppMessagesManager.getSearch(inputPeer, inputQuery, inputFilter, maxID).then(function (searchResult) { |
|
|
|
return loadingPromise = AppMessagesManager.getSearch(peerID, inputQuery, inputFilter, maxID).then(function (searchResult) { |
|
|
|
if (searchResult.history.length) { |
|
|
|
if (searchResult.history.length) { |
|
|
|
maxID = searchResult.history[searchResult.history.length - 1]; |
|
|
|
maxID = searchResult.history[searchResult.history.length - 1]; |
|
|
|
list = list.concat(searchResult.history); |
|
|
|
list = list.concat(searchResult.history); |
|
|
|