|
|
@ -2249,21 +2249,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
.controller('ChatModalController', function ($scope, $timeout, $rootScope, $modal, AppUsersManager, AppChatsManager, AppPhotosManager, MtpApiManager, MtpApiFileManager, NotificationsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager, ContactsSelectService, ErrorService) { |
|
|
|
.controller('ChatModalController', function ($scope, $timeout, $rootScope, $modal, AppUsersManager, AppChatsManager, AppPhotosManager, MtpApiManager, MtpApiFileManager, NotificationsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager, ContactsSelectService, ErrorService) { |
|
|
|
|
|
|
|
|
|
|
|
$scope.chatFull = AppChatsManager.wrapForFull($scope.chatID, {}); |
|
|
|
$scope.chatFull = AppChatsManager.wrapForFull($scope.chatID, {}); |
|
|
|
|
|
|
|
$scope.settings = {notifications: true}; |
|
|
|
|
|
|
|
|
|
|
|
MtpApiManager.invokeApi('messages.getFullChat', { |
|
|
|
AppChatsManager.getChatFull($scope.chatID).then(function (chatFull) { |
|
|
|
chat_id: $scope.chatID |
|
|
|
$scope.chatFull = AppChatsManager.wrapForFull($scope.chatID, chatFull); |
|
|
|
}).then(function (result) { |
|
|
|
|
|
|
|
AppChatsManager.saveApiChats(result.chats); |
|
|
|
|
|
|
|
AppUsersManager.saveApiUsers(result.users); |
|
|
|
|
|
|
|
if (result.full_chat && result.full_chat.chat_photo.id) { |
|
|
|
|
|
|
|
AppPhotosManager.savePhoto(result.full_chat.chat_photo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.chatFull = AppChatsManager.wrapForFull($scope.chatID, result.full_chat); |
|
|
|
|
|
|
|
$scope.$broadcast('ui_height'); |
|
|
|
$scope.$broadcast('ui_height'); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.settings = {notifications: true}; |
|
|
|
NotificationsManager.savePeerSettings(-$scope.chatID, chatFull.notify_settings); |
|
|
|
|
|
|
|
|
|
|
|
NotificationsManager.getPeerMuted(-$scope.chatID).then(function (muted) { |
|
|
|
NotificationsManager.getPeerMuted(-$scope.chatID).then(function (muted) { |
|
|
|
$scope.settings.notifications = !muted; |
|
|
|
$scope.settings.notifications = !muted; |
|
|
@ -2282,6 +2274,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function onStatedMessage (statedMessage) { |
|
|
|
function onStatedMessage (statedMessage) { |
|
|
|
AppMessagesManager.onStatedMessage(statedMessage); |
|
|
|
AppMessagesManager.onStatedMessage(statedMessage); |
|
|
|