Vulcan/packages/nova-comments/lib/notifications.js

17 lines
591 B
JavaScript
Raw Normal View History

2016-06-23 12:17:39 +09:00
import Comments from './collection.js';
2016-06-23 11:40:35 +09:00
import Posts from "meteor/nova:posts";
2016-05-17 12:18:05 +09:00
Comments.getNotificationProperties = function (data) {
const comment = data.comment;
2016-04-05 16:27:32 +09:00
var commentAuthor = Meteor.users.findOne(comment.userId);
2016-04-13 12:34:41 +09:00
var post = Posts.findOne(comment.postId);
2016-04-05 16:27:32 +09:00
var properties = {
profileUrl: commentAuthor && commentAuthor.getProfileUrl(true),
postUrl: Posts.getPageUrl(post, true),
authorName : Comments.getAuthorName(comment),
postTitle: post.title,
htmlBody: comment.htmlBody,
commentUrl: Comments.getPageUrl(comment, true)
};
return properties;
};