|
|
@ -230,6 +230,7 @@ angular.module('myApp.controllers', []) |
|
|
|
|
|
|
|
|
|
|
|
$scope.isLoggedIn = true; |
|
|
|
$scope.isLoggedIn = true; |
|
|
|
$scope.isEmpty = {}; |
|
|
|
$scope.isEmpty = {}; |
|
|
|
|
|
|
|
$scope.search = {}; |
|
|
|
$scope.historyFilter = {mediaType: false}; |
|
|
|
$scope.historyFilter = {mediaType: false}; |
|
|
|
$scope.historyPeer = {}; |
|
|
|
$scope.historyPeer = {}; |
|
|
|
|
|
|
|
|
|
|
@ -314,7 +315,17 @@ angular.module('myApp.controllers', []) |
|
|
|
|
|
|
|
|
|
|
|
updateCurDialog(); |
|
|
|
updateCurDialog(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var lastSearch = false; |
|
|
|
function updateCurDialog() { |
|
|
|
function updateCurDialog() { |
|
|
|
|
|
|
|
if ($routeParams.q) { |
|
|
|
|
|
|
|
if ($routeParams.q !== lastSearch) { |
|
|
|
|
|
|
|
$scope.search.query = lastSearch = $routeParams.q; |
|
|
|
|
|
|
|
$scope.search.messages = true; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
lastSearch = false; |
|
|
|
|
|
|
|
} |
|
|
|
$scope.curDialog = { |
|
|
|
$scope.curDialog = { |
|
|
|
peer: $routeParams.p || false, |
|
|
|
peer: $routeParams.p || false, |
|
|
|
messageID: $routeParams.m || false |
|
|
|
messageID: $routeParams.m || false |
|
|
@ -324,11 +335,10 @@ angular.module('myApp.controllers', []) |
|
|
|
ChangelogNotifyService.checkUpdate(); |
|
|
|
ChangelogNotifyService.checkUpdate(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
.controller('AppImDialogsController', function ($scope, $location, $q, $timeout, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, PhonebookContactsService, ErrorService) { |
|
|
|
.controller('AppImDialogsController', function ($scope, $location, $q, $timeout, $routeParams, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, PhonebookContactsService, ErrorService) { |
|
|
|
|
|
|
|
|
|
|
|
$scope.dialogs = []; |
|
|
|
$scope.dialogs = []; |
|
|
|
$scope.contacts = []; |
|
|
|
$scope.contacts = []; |
|
|
|
$scope.search = {}; |
|
|
|
|
|
|
|
$scope.contactsLoaded = false; |
|
|
|
$scope.contactsLoaded = false; |
|
|
|
$scope.phonebookAvailable = PhonebookContactsService.isAvailable(); |
|
|
|
$scope.phonebookAvailable = PhonebookContactsService.isAvailable(); |
|
|
|
|
|
|
|
|
|
|
@ -392,7 +402,7 @@ angular.module('myApp.controllers', []) |
|
|
|
var prevMessages = false; |
|
|
|
var prevMessages = false; |
|
|
|
$scope.$watchCollection('search', function () { |
|
|
|
$scope.$watchCollection('search', function () { |
|
|
|
if ($scope.search.messages && (!angular.isString($scope.search.query) || !$scope.search.query.length)) { |
|
|
|
if ($scope.search.messages && (!angular.isString($scope.search.query) || !$scope.search.query.length)) { |
|
|
|
prevMessages = $scope.search.messages = false; |
|
|
|
$scope.search.messages = false; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($scope.search.messages != prevMessages) { |
|
|
|
if ($scope.search.messages != prevMessages) { |
|
|
|
prevMessages = $scope.search.messages; |
|
|
|
prevMessages = $scope.search.messages; |
|
|
@ -401,6 +411,19 @@ angular.module('myApp.controllers', []) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
loadDialogs(); |
|
|
|
loadDialogs(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($routeParams.q && (!$scope.search.messages || $scope.search.query != $routeParams.q)) { |
|
|
|
|
|
|
|
$timeout(function () { |
|
|
|
|
|
|
|
$location.url( |
|
|
|
|
|
|
|
'/im' + |
|
|
|
|
|
|
|
($scope.curDialog.peer |
|
|
|
|
|
|
|
? '?p=' + $scope.curDialog.peer + |
|
|
|
|
|
|
|
($scope.curDialog.messageID ? '&m=' + $scope.curDialog.messageID : '') |
|
|
|
|
|
|
|
: '' |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$scope.importPhonebook = function () { |
|
|
|
$scope.importPhonebook = function () { |
|
|
|