exclude outbox from normal workflow

This commit is contained in:
Felix Hammerl 2014-02-18 17:05:51 +01:00
parent 700ecca0a3
commit 8973c3e2b3
2 changed files with 21 additions and 7 deletions

View File

@ -59,6 +59,11 @@ define(function(require) {
// //
$scope.getContent = function(email) { $scope.getContent = function(email) {
// don't stream message content of outbox messages...
if (getFolder().type === 'Outbox') {
return;
}
emailDao.getMessageContent({ emailDao.getMessageContent({
folder: getFolder().path, folder: getFolder().path,
message: email message: email
@ -72,17 +77,21 @@ define(function(require) {
* Called when clicking on an email list item * Called when clicking on an email list item
*/ */
$scope.select = function(email) { $scope.select = function(email) {
// unselect an item
if (!email) { if (!email) {
$scope.state.mailList.selected = undefined; $scope.state.mailList.selected = undefined;
return; return;
} }
emailDao.decryptMessageContent({ // if we're in the outbox, don't decrypt as usual
message: email if (getFolder().type !== 'Outbox') {
}, function(error) { emailDao.decryptMessageContent({
$scope.$apply(); message: email
$scope.onError(error); }, function(error) {
}); $scope.$apply();
$scope.onError(error);
});
}
$scope.state.mailList.selected = email; $scope.state.mailList.selected = email;
$scope.state.read.toggle(true); $scope.state.read.toggle(true);

View File

@ -249,7 +249,7 @@ define(function(require) {
scope.state = { scope.state = {
nav: { nav: {
currentFolder: { currentFolder: {
type: 'asd', type: 'asd'
} }
}, },
mailList: {}, mailList: {},
@ -278,6 +278,11 @@ define(function(require) {
mailList: {}, mailList: {},
read: { read: {
toggle: function() {} toggle: function() {}
},
nav: {
currentFolder: {
type: 'asd'
}
} }
}; };