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

19 lines
599 B
JavaScript
Raw Normal View History

2016-04-13 11:39:01 +09:00
Posts.getNotificationProperties = function (post) {
var postAuthor = Meteor.users.findOne(post.userId);
var properties = {
postAuthorName : Posts.getAuthorName(post),
postTitle : Telescope.utils.cleanUp(post.title),
profileUrl: Users.getProfileUrl(postAuthor, true),
postUrl: Posts.getPageUrl(post, true),
thumbnailUrl: post.thumbnailUrl,
linkUrl: !!post.url ? Telescope.utils.getOutgoingUrl(post.url) : Posts.getPageUrl(post, true)
};
2016-04-13 11:39:01 +09:00
if(post.url)
properties.url = post.url;
2016-04-13 11:39:01 +09:00
if(post.htmlBody)
properties.htmlBody = post.htmlBody;
return properties;
};