Vulcan/packages/nova-posts/lib/notifications.js
2016-06-23 11:40:35 +09:00

22 lines
No EOL
665 B
JavaScript

import Posts from './namespace.js'
Posts.getNotificationProperties = function (data) {
const post = data.post;
const postAuthor = Meteor.users.findOne(post.userId);
const 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)
};
if(post.url)
properties.url = post.url;
if(post.htmlBody)
properties.htmlBody = post.htmlBody;
return properties;
};