mirror of
https://github.com/moparisthebest/mail
synced 2024-11-29 20:32:15 -05:00
refactor config strings to be maintained centrally
This commit is contained in:
parent
f01253e504
commit
fc6618b443
@ -4,9 +4,7 @@ define([], function() {
|
||||
/**
|
||||
* Create the application namespace
|
||||
*/
|
||||
var app = {
|
||||
util: {}
|
||||
};
|
||||
var app = {};
|
||||
|
||||
/**
|
||||
* Global app configurations
|
||||
@ -16,9 +14,25 @@ define([], function() {
|
||||
symKeySize: 128,
|
||||
symIvSize: 128,
|
||||
asymKeySize: 1024,
|
||||
workerPath: 'js'
|
||||
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'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Strings are maintained here
|
||||
*/
|
||||
app.string = {
|
||||
signature: 'Sent securely from whiteout mail'
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ define(function(require) {
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
cloudstorage = require('js/dao/cloudstorage-dao'),
|
||||
app = require('js/app-config');
|
||||
config = require('js/app-config').config;
|
||||
require('cordova');
|
||||
|
||||
var self = {};
|
||||
@ -72,20 +72,20 @@ define(function(require) {
|
||||
auth = {
|
||||
XOAuth2: {
|
||||
user: userId,
|
||||
clientId: '440907777130.apps.googleusercontent.com',
|
||||
clientId: config.gmail.clientId,
|
||||
accessToken: token
|
||||
}
|
||||
};
|
||||
imapOptions = {
|
||||
secure: true,
|
||||
port: 993,
|
||||
host: 'imap.gmail.com',
|
||||
secure: config.gmail.imap.secure,
|
||||
port: config.gmail.imap.port,
|
||||
host: config.gmail.imap.host,
|
||||
auth: auth
|
||||
};
|
||||
smtpOptions = {
|
||||
secure: true,
|
||||
port: 465,
|
||||
host: 'smtp.gmail.com',
|
||||
secure: config.gmail.smtp.secure,
|
||||
port: config.gmail.smtp.port,
|
||||
host: config.gmail.smtp.host,
|
||||
auth: auth
|
||||
};
|
||||
|
||||
@ -98,9 +98,9 @@ define(function(require) {
|
||||
// init email dao
|
||||
var account = {
|
||||
emailAddress: userId,
|
||||
symKeySize: app.config.symKeySize,
|
||||
symIvSize: app.config.symIvSize,
|
||||
asymKeySize: app.config.asymKeySize
|
||||
symKeySize: config.symKeySize,
|
||||
symIvSize: config.symIvSize,
|
||||
asymKeySize: config.asymKeySize
|
||||
};
|
||||
self._emailDao.init(account, password, callback);
|
||||
};
|
||||
|
@ -5,8 +5,7 @@ define(function(require) {
|
||||
util = require('cryptoLib/util'),
|
||||
crypto = require('js/crypto/crypto'),
|
||||
jsonDB = require('js/dao/lawnchair-dao'),
|
||||
devicestorage = require('js/dao/devicestorage-dao'),
|
||||
app = require('js/app-config');
|
||||
devicestorage = require('js/dao/devicestorage-dao');
|
||||
|
||||
var SUBJECT = '[whiteout] Encrypted message',
|
||||
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/whiteout-mail/jjgghafhamholjigjoghcfcekhkonijg\n\n\n',
|
||||
@ -511,9 +510,9 @@ define(function(require) {
|
||||
|
||||
// cache collection in folder memory
|
||||
if (decryptedList.length > 0) {
|
||||
folder = new app.model.Folder({
|
||||
folder = {
|
||||
name: folderName
|
||||
});
|
||||
};
|
||||
folder.set('items', decryptedList);
|
||||
self._account.get('folders').add(folder);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user