|
|
@ -453,6 +453,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
selectActions: false, |
|
|
|
selectActions: false, |
|
|
|
botActions: false, |
|
|
|
botActions: false, |
|
|
|
channelActions: false, |
|
|
|
channelActions: false, |
|
|
|
|
|
|
|
canReply: false, |
|
|
|
|
|
|
|
canDelete: false, |
|
|
|
actions: function () { |
|
|
|
actions: function () { |
|
|
|
return $scope.historyState.selectActions ? 'selected' : ($scope.historyState.botActions ? 'bot' : ($scope.historyState.channelActions ? 'channel' : false)); |
|
|
|
return $scope.historyState.selectActions ? 'selected' : ($scope.historyState.botActions ? 'bot' : ($scope.historyState.channelActions ? 'channel' : false)); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -1009,6 +1011,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
$scope.historyState.selectActions = false; |
|
|
|
$scope.historyState.selectActions = false; |
|
|
|
$scope.historyState.botActions = false; |
|
|
|
$scope.historyState.botActions = false; |
|
|
|
$scope.historyState.channelActions = false; |
|
|
|
$scope.historyState.channelActions = false; |
|
|
|
|
|
|
|
$scope.historyState.canDelete = false; |
|
|
|
|
|
|
|
$scope.historyState.canReply = false; |
|
|
|
$scope.historyState.missedCount = 0; |
|
|
|
$scope.historyState.missedCount = 0; |
|
|
|
$scope.historyState.skipped = false; |
|
|
|
$scope.historyState.skipped = false; |
|
|
|
$scope.state = {}; |
|
|
|
$scope.state = {}; |
|
|
@ -1203,10 +1207,10 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
var channel; |
|
|
|
var channel; |
|
|
|
if (peerID && |
|
|
|
if (peerID && |
|
|
|
AppPeersManager.isChannel(peerID) && |
|
|
|
AppPeersManager.isChannel(peerID) && |
|
|
|
(channel = AppChatsManager.getChat(-peerID)) && |
|
|
|
(channel = AppChatsManager.getChat(-peerID))) { |
|
|
|
!channel.pFlags.creator && |
|
|
|
|
|
|
|
!channel.pFlags.editor) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var canSend = channel.pFlags.creator || channel.pFlags.editor; |
|
|
|
|
|
|
|
if (!canSend) { |
|
|
|
if (channel.pFlags.left) { |
|
|
|
if (channel.pFlags.left) { |
|
|
|
$scope.historyState.channelActions = 'join'; |
|
|
|
$scope.historyState.channelActions = 'join'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -1217,9 +1221,16 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
$scope.historyState.channelActions = muted ? 'unmute' : 'mute'; |
|
|
|
$scope.historyState.channelActions = muted ? 'unmute' : 'mute'; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$scope.historyState.channelActions = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$scope.historyState.canReply = canSend; |
|
|
|
|
|
|
|
$scope.historyState.canDelete = canSend || channel.pFlags.moderator; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
$scope.historyState.channelActions = false; |
|
|
|
$scope.historyState.channelActions = false; |
|
|
|
|
|
|
|
$scope.historyState.canReply = true; |
|
|
|
|
|
|
|
$scope.historyState.canDelete = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (wasChannelActions != $scope.historyState.channelActions) { |
|
|
|
if (wasChannelActions != $scope.historyState.channelActions) { |
|
|
|
$scope.$broadcast('ui_panel_update'); |
|
|
|
$scope.$broadcast('ui_panel_update'); |
|
|
|