Skip to content

Commit

Permalink
Revert "Merge pull request #26 from CMU-313/anonymous-feature"
Browse files Browse the repository at this point in the history
This reverts commit 1ba80bc, reversing
changes made to aef0de0.
  • Loading branch information
VeronicaPim committed Oct 9, 2024
1 parent 0f3ba1f commit 6e2c4bd
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 0 deletions.
43 changes: 43 additions & 0 deletions node_modules/nodebb-plugin-composer-default/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/posts/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ module.exports = function (Posts) {
tid: tid,
content: content,
timestamp: timestamp,
<<<<<<< HEAD
anonymous: data.anonymous ? 1 : 0, // Added anonymous status
=======
>>>>>>> parent of 1ba80bc2 (Merge pull request #26 from CMU-313/anonymous-feature)
};

if (data.toPid) {
Expand Down
8 changes: 8 additions & 0 deletions src/posts/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ module.exports = function (Posts) {
posts: postData,
fields: fields,
});
<<<<<<< HEAD
result.posts.forEach((post) => {
modifyPost(post, fields);
if (post.anonymous === 1) {
post.uid = null;
}
});
=======
result.posts.forEach(post => modifyPost(post, fields));
>>>>>>> parent of 1ba80bc2 (Merge pull request #26 from CMU-313/anonymous-feature)
return result.posts;
};

Posts.getPostData = async function (pid) {
const posts = await Posts.getPostsFields([pid], []);
<<<<<<< HEAD
if (posts && posts.length) {
const post = posts[0];
if (post.anonymous === 1) {
Expand All @@ -41,6 +46,9 @@ module.exports = function (Posts) {
return post;
}
return null;
=======
return posts && posts.length ? posts[0] : null;
>>>>>>> parent of 1ba80bc2 (Merge pull request #26 from CMU-313/anonymous-feature)
};

Posts.getPostsData = async function (pids) {
Expand Down

0 comments on commit 6e2c4bd

Please sign in to comment.