diff --git a/packages/telescope-comments/lib/comments.js b/packages/telescope-comments/lib/comments.js index a5780d94e..cec01dc9d 100644 --- a/packages/telescope-comments/lib/comments.js +++ b/packages/telescope-comments/lib/comments.js @@ -123,7 +123,7 @@ Comments.before.update(function (userId, doc, fieldNames, modifier, options) { } }); -commentAfterSubmitMethodCallbacks.push(function (comment) { +function afterCommentOperations (comment) { var userId = comment.userId, commentAuthor = Meteor.users.findOne(userId); @@ -143,7 +143,11 @@ commentAfterSubmitMethodCallbacks.push(function (comment) { // upvote comment Telescope.upvoteItem(Comments, comment, commentAuthor); -}); + return comment; + +}; + +commentAfterSubmitMethodCallbacks.push(afterCommentOperations); // ------------------------------------------------------------------------------------------- // // -------------------------------------- Submit Comment ------------------------------------- // diff --git a/packages/telescope-notifications/lib/notifications.js b/packages/telescope-notifications/lib/notifications.js index f2792860b..751606259 100644 --- a/packages/telescope-notifications/lib/notifications.js +++ b/packages/telescope-notifications/lib/notifications.js @@ -26,7 +26,8 @@ Posts.hooks.approvedCallbacks.push(function (post) { }); // add new comment notification callback on comment submit -commentAfterSubmitMethodCallbacks.push(function (comment) { +function addCommentNotification (comment) { + if(Meteor.isServer && !comment.disableNotifications){ var post = Posts.findOne(comment.postId), @@ -81,7 +82,9 @@ commentAfterSubmitMethodCallbacks.push(function (comment) { return comment; -}); +} + +commentAfterSubmitMethodCallbacks.push(addCommentNotification); var emailNotifications = { propertyName: 'emailNotifications',