From e751a0c0cf74633f753ab4d131b877d6ae37955e Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 23 Aug 2014 22:34:39 -0400 Subject: [PATCH 1/2] closes #2003 --- src/posts.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/posts.js b/src/posts.js index 1392ac0372..a2c691dc28 100644 --- a/src/posts.js +++ b/src/posts.js @@ -336,6 +336,14 @@ var async = require('async'), return obj; } + function stripTags(content) { + if (options.stripTags && content) { + var s = S(content); + return s.stripTags.apply(s, utils.stripTags).s; + } + return content; + } + if (err) { return callback(err); } @@ -361,6 +369,7 @@ var async = require('async'), post.relativeTime = utils.toISOString(post.timestamp); if (!post.content || !options.parse) { + post.content = stripTags(post.content); return next(null, post); } @@ -369,12 +378,7 @@ var async = require('async'), return next(err); } - if (options.stripTags && content) { - var s = S(content); - post.content = s.stripTags.apply(s, utils.stripTags).s; - } else { - post.content = content; - } + post.content = stripTags(content); next(null, post); }); From b856ddb98f30abd95399e7f234a147790bdbcf5a Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 25 Aug 2014 19:59:03 -0400 Subject: [PATCH 2/2] closes #2018 --- src/user/notifications.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/user/notifications.js b/src/user/notifications.js index f6e85aa05f..a60e8de26e 100644 --- a/src/user/notifications.js +++ b/src/user/notifications.js @@ -127,7 +127,7 @@ var async = require('async'), if (err || !notif_data) { return next(err); } - UserNotifications.isNotificationRead(notif_data.nid, uid, function(err, isRead) { + UserNotifications.isNotificationRead(notif_data.uniqueId, uid, function(err, isRead) { if (err) { return next(err); } @@ -156,8 +156,8 @@ var async = require('async'), }); }; - UserNotifications.isNotificationRead = function(nid, uid, callback) { - db.isSortedSetMember('uid:' + uid + ':notifications:read', nid, callback); + UserNotifications.isNotificationRead = function(uniqueId, uid, callback) { + db.isSortedSetMember('uid:' + uid + ':notifications:read', uniqueId, callback); }; UserNotifications.getDailyUnread = function(uid, callback) {