2016-06-23 12:17:39 +09:00
|
|
|
import Posts from './collection.js'
|
2016-06-23 15:00:58 +09:00
|
|
|
import Users from 'meteor/nova:users';
|
2016-06-15 11:07:10 +09:00
|
|
|
|
2016-05-20 09:32:37 +09:00
|
|
|
Posts.getNotificationProperties = function (data) {
|
|
|
|
const post = data.post;
|
|
|
|
const postAuthor = Meteor.users.findOne(post.userId);
|
|
|
|
const properties = {
|
2016-04-13 11:39:01 +09:00
|
|
|
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-02-17 21:57:07 +09:00
|
|
|
|
2016-04-13 11:39:01 +09:00
|
|
|
if(post.url)
|
|
|
|
properties.url = post.url;
|
2016-02-17 21:57:07 +09:00
|
|
|
|
2016-04-13 11:39:01 +09:00
|
|
|
if(post.htmlBody)
|
|
|
|
properties.htmlBody = post.htmlBody;
|
|
|
|
|
|
|
|
return properties;
|
2016-04-13 12:55:21 +09:00
|
|
|
};
|