diff --git a/src/topics.js b/src/topics.js index a52e32c81a..21a6861b54 100644 --- a/src/topics.js +++ b/src/topics.js @@ -561,20 +561,22 @@ var RDB = require('./redis.js') return callback(err, null); var stripped = postData.content, - timestamp = postData.timestamp; - - if(postData.content) { + timestamp = postData.timestamp, + returnObj = { + "username": userData.username, + "picture": userData.picture, + "timestamp" : timestamp + }; + + if (postData.content) { stripped = postData.content.replace(/>.+\n\n/, ''); postTools.toHTML(stripped, function(err, stripped) { - stripped = utils.strip_tags(stripped); - - callback(null, { - "text": stripped, - "username": userData.username, - "picture": userData.picture, - "timestamp" : timestamp - }); + returnObj.text = utils.strip_tags(stripped); + callback(null, returnObj); }); + } else { + returnObj.text = ''; + callback(null, returnObj); } }); }); diff --git a/src/user.js b/src/user.js index 3ac1b7830d..5f84b492fb 100644 --- a/src/user.js +++ b/src/user.js @@ -3,7 +3,7 @@ var utils = require('./../public/src/utils.js'), crypto = require('crypto'), emailjs = require('emailjs'), meta = require('./meta.js'), - emailjsServer = emailjs.server.connect(meta.config.mailer), + emailjsServer = emailjs.server.connect(meta.config.mailer || '127.0.0.1'), bcrypt = require('bcrypt'), notifications = require('./notifications.js'), topics = require('./topics.js'),