Skip to content

Commit

Permalink
added some comments
Browse files Browse the repository at this point in the history
added some comments
  • Loading branch information
NelsonPereira1991 committed Aug 1, 2017
1 parent 99d0944 commit 572a932
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/controllers/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ var getLikesForAPost = function (postUri, callback) {
}, null, db_social.graphUri, null);
};

//for processing various posts
var getSharesOrPostsInfo = function (postsQueryInfo, cb) {
var getCommentsForAPost = function (post, cb) {
post.getComments(function (err, commentsData) {
Expand Down Expand Up @@ -1504,8 +1505,6 @@ var getSharesOrPostsInfo = function (postsQueryInfo, cb) {
});
};

//postsQueryInfo = JSON.parse(postsQueryInfo);
/*let postsInfo = new Array(postsQueryInfo.length);*/
let postsInfo = {};

async.map(postsQueryInfo, function (postQueryInfo, callback) {
Expand Down Expand Up @@ -1564,9 +1563,9 @@ var getSharesOrPostsInfo = function (postsQueryInfo, cb) {
}, null, db_social.graphUri, false, null, null);
}
else if (post.rdf.type === "http://dendro.fe.up.pt/ontology/0.1/Share") {
console.log("IS A SHARE");
Share.findByUri(post.uri, function (err, share) {
if (!err) {
//Gets the info from the original post that was shared
getSharesOrPostsInfo([{uri: share.ddr.postURI}], function (err, originalPostInfo) {
if(err || isNull(originalPostInfo))
{
Expand All @@ -1587,7 +1586,6 @@ var getSharesOrPostsInfo = function (postsQueryInfo, cb) {
callback(err);
}
}, null, db_social.graphUri, false, null, null);
//callback(null);
}
else {
callback(null);
Expand All @@ -1597,7 +1595,6 @@ var getSharesOrPostsInfo = function (postsQueryInfo, cb) {
function (err, results) {
if (isNull(err)) {
postsInfo[postQueryInfo.uri] = post;
//postsInfo.push(post);
}
callback(err, results);
});
Expand Down

0 comments on commit 572a932

Please sign in to comment.