|
|
|
@ -1941,15 +1941,34 @@ angular.module('myApp.controllers', ['myApp.i18n'])
@@ -1941,15 +1941,34 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (selectedMessageIDs.length) { |
|
|
|
|
PeersSelectService.selectPeer({canSend: true}).then(function (peerString) { |
|
|
|
|
PeersSelectService.selectPeer({canSend: true}).then(function (peerStrings) { |
|
|
|
|
selectedCancel() |
|
|
|
|
$rootScope.$broadcast('history_focus', { |
|
|
|
|
peerString: peerString, |
|
|
|
|
attachment: { |
|
|
|
|
_: 'fwd_messages', |
|
|
|
|
id: selectedMessageIDs |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if (Array.isArray(peerStrings) && peerStrings.length > 1) { |
|
|
|
|
angular.forEach(peerStrings, function (peerString) { |
|
|
|
|
var peerID = AppPeersManager.getPeerID(peerString) |
|
|
|
|
AppMessagesManager.forwardMessages(peerID, selectedMessageIDs) |
|
|
|
|
}) |
|
|
|
|
var toastData = toaster.pop({ |
|
|
|
|
type: 'info', |
|
|
|
|
body: _('confirm_modal_forward_to_peer_success'), |
|
|
|
|
bodyOutputType: 'trustedHtml', |
|
|
|
|
clickHandler: function () { |
|
|
|
|
$rootScope.$broadcast('history_focus', { |
|
|
|
|
peerString: peerStrings[0] |
|
|
|
|
}) |
|
|
|
|
toaster.clear(toastData) |
|
|
|
|
}, |
|
|
|
|
showCloseButton: false |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
$rootScope.$broadcast('history_focus', { |
|
|
|
|
peerString: peerStrings, |
|
|
|
|
attachment: { |
|
|
|
|
_: 'fwd_messages', |
|
|
|
|
id: selectedMessageIDs |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -4926,6 +4945,30 @@ angular.module('myApp.controllers', ['myApp.i18n'])
@@ -4926,6 +4945,30 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.dialogMultiSelect = function(peerString, event) { |
|
|
|
|
var peerID = AppPeersManager.getPeerID(peerString) |
|
|
|
|
$scope.multiSelect = $scope.selectedPeers[peerID] == undefined || |
|
|
|
|
$scope.selectedPeers[peerID] != undefined && Object.keys($scope.selectedPeers).length > 1 |
|
|
|
|
if ($scope.selectedPeers[peerID]) { |
|
|
|
|
delete $scope.selectedPeers[peerID] |
|
|
|
|
$scope.selectedCount-- |
|
|
|
|
var pos = $scope.selectedPeerIDs.indexOf(peerID) |
|
|
|
|
if (pos >= 0) { |
|
|
|
|
$scope.selectedPeerIDs.splice(pos, 1) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$scope.selectedPeers[peerID] = AppPeersManager.getPeer(peerID) |
|
|
|
|
$scope.selectedCount++ |
|
|
|
|
$scope.selectedPeerIDs.unshift(peerID) |
|
|
|
|
} |
|
|
|
|
cancelEvent(event) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.isSelected = function(peerString){ |
|
|
|
|
var peerID = AppPeersManager.getPeerID(peerString) |
|
|
|
|
return $scope.selectedPeers[peerID] != undefined |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.dialogSelect = function (peerString) { |
|
|
|
|
var peerID |
|
|
|
|
if (!$scope.multiSelect) { |
|
|
|
|