|
|
|
@ -505,6 +505,7 @@ angular.module('myApp.controllers', [])
@@ -505,6 +505,7 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
$scope.missedCount = 0; |
|
|
|
|
} |
|
|
|
|
$scope.mediaType = mediaType || false; |
|
|
|
|
$scope.history = []; |
|
|
|
|
loadHistory(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -719,9 +720,11 @@ angular.module('myApp.controllers', [])
@@ -719,9 +720,11 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
|
|
|
|
|
NotificationsManager.getPeerMuted($scope.userID).then(function (muted) { |
|
|
|
|
$scope.settings.notifications = !muted; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$watch('settings.notifications', function(newValue) { |
|
|
|
|
$scope.$watch('settings.notifications', function(newValue, oldValue) { |
|
|
|
|
if (newValue === oldValue) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
NotificationsManager.getPeerSettings($scope.userID).then(function (settings) { |
|
|
|
|
if (newValue) { |
|
|
|
|
settings.mute_until = 0; |
|
|
|
@ -731,6 +734,8 @@ angular.module('myApp.controllers', [])
@@ -731,6 +734,8 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
NotificationsManager.savePeerSettings($scope.userID, settings); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.goToHistory = function () { |
|
|
|
|
$rootScope.$broadcast('history_focus', {peerString: $scope.user.peerString}); |
|
|
|
@ -763,9 +768,11 @@ angular.module('myApp.controllers', [])
@@ -763,9 +768,11 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
|
|
|
|
|
NotificationsManager.getPeerMuted(-$scope.chatID).then(function (muted) { |
|
|
|
|
$scope.settings.notifications = !muted; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$watch('settings.notifications', function(newValue) { |
|
|
|
|
$scope.$watch('settings.notifications', function(newValue, oldValue) { |
|
|
|
|
if (newValue === oldValue) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
NotificationsManager.getPeerSettings(-$scope.chatID).then(function (settings) { |
|
|
|
|
if (newValue) { |
|
|
|
|
settings.mute_until = 0; |
|
|
|
@ -775,6 +782,8 @@ angular.module('myApp.controllers', [])
@@ -775,6 +782,8 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
NotificationsManager.savePeerSettings(-$scope.chatID, settings); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.leaveGroup = function () { |
|
|
|
|
MtpApiManager.invokeApi('messages.deleteChatUser', { |
|
|
|
@ -843,9 +852,11 @@ angular.module('myApp.controllers', [])
@@ -843,9 +852,11 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
$scope.notify.desktop = !settings[0]; |
|
|
|
|
$scope.notify.sound = !settings[1]; |
|
|
|
|
$scope.send.enter = settings[2] ? '' : '1'; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$watch('notify.sound', function(newValue) { |
|
|
|
|
$scope.$watch('notify.sound', function(newValue, oldValue) { |
|
|
|
|
if (newValue === oldValue) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (newValue) { |
|
|
|
|
AppConfigManager.remove('notify_nosound'); |
|
|
|
|
} else { |
|
|
|
@ -854,7 +865,10 @@ angular.module('myApp.controllers', [])
@@ -854,7 +865,10 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$watch('notify.desktop', function(newValue) { |
|
|
|
|
$scope.$watch('notify.desktop', function(newValue, oldValue) { |
|
|
|
|
if (newValue === oldValue) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (newValue) { |
|
|
|
|
AppConfigManager.remove('notify_nodesktop'); |
|
|
|
|
} else { |
|
|
|
@ -862,7 +876,10 @@ angular.module('myApp.controllers', [])
@@ -862,7 +876,10 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$watch('send.enter', function(newValue) { |
|
|
|
|
$scope.$watch('send.enter', function(newValue, oldValue) { |
|
|
|
|
if (newValue === oldValue) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (newValue) { |
|
|
|
|
AppConfigManager.remove('send_ctrlenter'); |
|
|
|
|
} else { |
|
|
|
@ -870,6 +887,8 @@ angular.module('myApp.controllers', [])
@@ -870,6 +887,8 @@ angular.module('myApp.controllers', [])
|
|
|
|
|
} |
|
|
|
|
$rootScope.$broadcast('settings_changed'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.error = {}; |
|
|
|
|
$scope.save = function (profileForm) { |
|
|
|
|