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

18 lines
629 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";
import Users from 'meteor/nova:users';
2016-06-23 11:40:35 +09:00
2016-05-17 12:18:05 +09:00
Comments.getNotificationProperties = function (data) {
const comment = data.comment;
const commentAuthor = Users.findOne(comment.userId);
const post = Posts.findOne(comment.postId);
const properties = {
2016-04-05 16:27:32 +09:00
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;
};