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,22 +1,30 @@
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
try {
var manifest = chrome.runtime.getManifest();
cloudUrl = _.find(manifest.permissions, function(permission) {
return typeof permission === 'string' && permission.indexOf('http') === 0;
});
clientId = manifest.oauth2.client_id;
} catch (e) {}
/** /**
* Global app configurations * Global app configurations
*/ */
app.config = { app.config = {
cloudUrl: 'https://keys.whiteout.io', cloudUrl: cloudUrl || 'https://keys.whiteout.io',
symKeySize: 128, symKeySize: 128,
symIvSize: 128, symIvSize: 128,
asymKeySize: 2048, asymKeySize: 2048,
workerPath: 'js', workerPath: 'js',
gmail: { gmail: {
clientId: '440907777130.apps.googleusercontent.com', clientId: clientId || '440907777130.apps.googleusercontent.com',
imap: { imap: {
secure: true, secure: true,
port: 993, port: 993,
@ -28,7 +36,7 @@ define([], function() {
host: 'smtp.gmail.com' host: 'smtp.gmail.com'
} }
}, },
checkOutboxInterval: 30000, checkOutboxInterval: 5000,
iconPath: '/img/icon.png', iconPath: '/img/icon.png',
verificationUrl: '/verify/' verificationUrl: '/verify/'
}; };

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",