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

View File

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