diff --git a/core/client.js b/core/client.js index 76c44b7a..5bc795ed 100644 --- a/core/client.js +++ b/core/client.js @@ -107,6 +107,7 @@ function Client(input, output) { // // Every 1m, check for idle. // + console.log('idleLogoutSeconds=' + Config.misc.idleLogoutSeconds) this.idleCheck = setInterval(function checkForIdle() { var nowMs = Date.now(); diff --git a/core/config.js b/core/config.js index 45c44cf4..56db26a3 100644 --- a/core/config.js +++ b/core/config.js @@ -13,24 +13,6 @@ exports.init = init; exports.getDefaultPath = getDefaultPath; function init(configPath, cb) { - - // Probably many better ways of doing this: - // :TODO: See http://jsfiddle.net/jlowery2663/z8at6knn/4/ - var recursiveMerge = function(target, source) { - for(var p in source) { - try { - if(_.isObject(source)) { - target[p] = recursiveMerge(target[p], source[p]); - } else { - target[p] = source[p]; - } - } catch(e) { - target[p] = source[p]; - } - } - return target; - }; - async.waterfall( [ function loadUserConfig(callback) { @@ -48,8 +30,8 @@ function init(configPath, cb) { } }); }, - function mergeWithDefaultConfig(menuConfig, callback) { - var mergedConfig = recursiveMerge(menuConfig, getDefaultConfig()); + function mergeWithDefaultConfig(configJson, callback) { + var mergedConfig = _.defaultsDeep(configJson, getDefaultConfig()); callback(null, mergedConfig); } ], diff --git a/mods/fse.js b/mods/fse.js index a802786c..39660af4 100644 --- a/mods/fse.js +++ b/mods/fse.js @@ -34,8 +34,14 @@ function FullScreenEditorModule(options) { this.artNames = [ 'header', 'body', 'footerEdit', 'footerEditMenu', 'footerView' ]; - // :TODO: This needs to be passed in via args: + // :TODO: The following needs to be passed in via args: this.editorMode = 'edit'; // view | edit | editMenu | + this.isLocal = true; + + this.toUserId = options.toUserId || 0; + this.fromUserId = options.fromUserId || 0; + + // netMail/crashMail | echoMail this.messageAreaId = 'netMail' === this.editorType ? Message.WellKnownAreaIds.Private : options.messageAreaId; @@ -66,15 +72,23 @@ function FullScreenEditorModule(options) { fromUserName : headerValues.from, subject : headerValues.subject, message : self.viewControllers.body.getFormData().value.message, + + }; console.log(messageOpts); - /*var msg = new Message(messageOpts); - msg.persist(function persisted(err, msgId) { + var msg = new Message(messageOpts); + + if(self.isLocal) { + msg.meta.System.local_to_user_id = self.toUserId; + msg.meta.System.local_from_user_id = self.fromUserId; + } + + /*msg.persist(function persisted(err, msgId) { + + });*/ - }); -*/ }; this.redrawFooter = function(options, cb) {