1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-23 01:12:19 -05:00

Review invite sending and release to TEST channel

This commit is contained in:
Tankred Hase 2013-11-21 15:36:16 +01:00
parent ab43098fe5
commit e13268625f
5 changed files with 78 additions and 77 deletions

View File

@ -1,52 +1,60 @@
define([], function() { define(function(require) {
'use strict'; 'use strict';
/** var _ = require('underscore'),
* Create the application namespace app = {},
*/ cloudUrl, clientId;
var app = {};
/** // parse manifest to get configurations for current runtime
* Global app configurations try {
*/ var manifest = chrome.runtime.getManifest();
app.config = { cloudUrl = _.find(manifest.permissions, function(permission) {
cloudUrl: 'https://keys.whiteout.io', return typeof permission === 'string' && permission.indexOf('http') === 0;
symKeySize: 128, });
symIvSize: 128, clientId = manifest.oauth2.client_id;
asymKeySize: 2048, } catch (e) {}
workerPath: 'js',
gmail: {
clientId: '440907777130.apps.googleusercontent.com',
imap: {
secure: true,
port: 993,
host: 'imap.gmail.com'
},
smtp: {
secure: true,
port: 465,
host: 'smtp.gmail.com'
}
},
checkOutboxInterval: 30000,
iconPath: '/img/icon.png',
verificationUrl: '/verify/'
};
/** /**
* Strings are maintained here * Global app configurations
*/ */
app.string = { app.config = {
subjectPrefix: '[whiteout] ', cloudUrl: cloudUrl || 'https://keys.whiteout.io',
invitationSubject: 'Invitation to a private conversation', symKeySize: 128,
invitationMessage: 'I would like to invite you to a private conversation. To read my encrypted messages, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg', symIvSize: 128,
message: 'this is a private conversation. To read my encrypted message below, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg', asymKeySize: 2048,
cryptPrefix: '-----BEGIN PGP MESSAGE-----', workerPath: 'js',
cryptSuffix: '-----END PGP MESSAGE-----', gmail: {
signature: 'Sent securely from whiteout mail', clientId: clientId || '440907777130.apps.googleusercontent.com',
webSite: 'http://whiteout.io', imap: {
verificationSubject: 'New public key uploaded' secure: true,
}; port: 993,
host: 'imap.gmail.com'
},
smtp: {
secure: true,
port: 465,
host: 'smtp.gmail.com'
}
},
checkOutboxInterval: 5000,
iconPath: '/img/icon.png',
verificationUrl: '/verify/'
};
return app; /**
* Strings are maintained here
*/
app.string = {
subjectPrefix: '[whiteout] ',
invitationSubject: 'Invitation to a private conversation',
invitationMessage: 'I would like to invite you to a private conversation. To read my encrypted messages, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg',
message: 'this is a private conversation. To read my encrypted message below, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg',
cryptPrefix: '-----BEGIN PGP MESSAGE-----',
cryptSuffix: '-----END PGP MESSAGE-----',
signature: 'Sent securely from whiteout mail',
webSite: 'http://whiteout.io',
verificationSubject: 'New public key uploaded'
};
return app;
}); });

View File

@ -36,6 +36,19 @@ define(function(require) {
$scope.state.nav.toggle(false); $scope.state.nav.toggle(false);
}; };
$scope.onOutboxUpdate = function(err, count) {
if (err) {
$scope.onError(err);
return;
}
var outbox = _.findWhere($scope.folders, {
type: 'Outbox'
});
outbox.count = count;
$scope.$apply();
};
// //
// Start // Start
// //
@ -64,7 +77,9 @@ define(function(require) {
}); });
// start checking outbox periodically // start checking outbox periodically
outboxBo.startChecking(onOutboxUpdate); outboxBo.startChecking($scope.onOutboxUpdate);
// make function available globally for write controller
$scope.emptyOutbox = outboxBo._processOutbox;
callback(folders); callback(folders);
$scope.$apply(); $scope.$apply();
@ -94,22 +109,6 @@ define(function(require) {
path: 'TRASH' path: 'TRASH'
}]); }]);
} }
// update outbox count
function onOutboxUpdate(err, count) {
if (err) {
$scope.onError(err);
return;
}
var outbox = _.findWhere($scope.folders, {
type: 'Outbox'
});
outbox.count = count;
$scope.$apply();
}
}; };
// //

View File

@ -146,15 +146,6 @@ define(function(require) {
return; return;
} }
// only allow secure recipients until invitation is implemented
if (!$scope.toKey) {
$scope.onError({
errMsg: 'Invitations not yet supported!',
sync: true
});
return;
}
// remove generated html from body // remove generated html from body
body = parseBody($scope.body); body = parseBody($scope.body);
@ -184,7 +175,7 @@ define(function(require) {
$scope.state.writer.close(); $scope.state.writer.close();
$scope.$apply(); $scope.$apply();
$scope.emptyOutbox(); $scope.emptyOutbox($scope.onOutboxUpdate);
markAnwsered(); markAnwsered();
}); });

View File

@ -35,7 +35,7 @@ define(function() {
return; return;
} }
this._restDao.put(null, uri(options.recipient, options.sender), completed); this._restDao.put({}, uri(options.recipient, options.sender), completed);
function completed(error, res, status) { function completed(error, res, status) {
if (error) { if (error) {
@ -71,7 +71,10 @@ define(function() {
return; return;
} }
this._restDao.get(null, uri(options.recipient, options.sender), completed); this._restDao.get({
uri: uri(options.recipient, options.sender),
type: 'text'
}, completed);
function completed(error, res, status) { function completed(error, res, status) {
// 404 is a meaningful return value from the web service // 404 is a meaningful return value from the web service

View File

@ -12,7 +12,7 @@
"fileSystem": ["write"] "fileSystem": ["write"]
}, },
"notifications", "notifications",
"https://keys.whiteout.io/", "https://keys-test.whiteout.io",
"identity", { "identity", {
"socket": [ "socket": [
"tcp-connect:imap.gmail.com:993", "tcp-connect:imap.gmail.com:993",