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-10-05 08:37:48 +02:00
|
|
|
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;
|
2016-10-05 08:37:48 +02:00
|
|
|
const commentAuthor = Users.findOne(comment.userId);
|
2016-08-10 07:49:40 +02:00
|
|
|
const post = Posts.findOne(comment.postId);
|
|
|
|
const properties = {
|
2016-11-30 10:21:25 +09:00
|
|
|
profileUrl: commentAuthor && Users.getProfileUrl(commentAuthor, true),
|
2016-04-05 16:27:32 +09:00
|
|
|
postUrl: Posts.getPageUrl(post, true),
|
|
|
|
authorName : Comments.getAuthorName(comment),
|
|
|
|
postTitle: post.title,
|
|
|
|
htmlBody: comment.htmlBody,
|
|
|
|
commentUrl: Comments.getPageUrl(comment, true)
|
|
|
|
};
|
|
|
|
return properties;
|
2016-04-13 12:55:21 +09:00
|
|
|
};
|