Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous feature - merge to main branch (front & back) #26

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 46 additions & 21 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.

1 change: 1 addition & 0 deletions src/posts/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
tid: tid,
content: content,
timestamp: timestamp,
anonymous: data.anonymous ? 1 : 0, // Added anonymous status

Check failure on line 38 in src/posts/create.js

View workflow job for this annotation

GitHub Actions / test

Multiple spaces found before '// Added anony...'
};

if (data.toPid) {
Expand Down
16 changes: 14 additions & 2 deletions src/posts/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@
posts: postData,
fields: fields,
});
result.posts.forEach(post => modifyPost(post, fields));
result.posts.forEach(post => {

Check failure on line 25 in src/posts/data.js

View workflow job for this annotation

GitHub Actions / test

Expected parentheses around arrow function argument having a body with curly braces
modifyPost(post, fields);
if (post.anonymous ==1){

Check failure on line 27 in src/posts/data.js

View workflow job for this annotation

GitHub Actions / test

Operator '==' must be spaced

Check failure on line 27 in src/posts/data.js

View workflow job for this annotation

GitHub Actions / test

Expected '===' and instead saw '=='

Check failure on line 27 in src/posts/data.js

View workflow job for this annotation

GitHub Actions / test

Missing space before opening brace
post.uid = null;

Check failure on line 28 in src/posts/data.js

View workflow job for this annotation

GitHub Actions / test

Trailing spaces not allowed
}
});
return result.posts;
};

Posts.getPostData = async function (pid) {
const posts = await Posts.getPostsFields([pid], []);
return posts && posts.length ? posts[0] : null;
if (posts && posts.length) {
const post = posts[0];
if (post.anonymous == 1) {

Check failure on line 38 in src/posts/data.js

View workflow job for this annotation

GitHub Actions / test

Expected '===' and instead saw '=='
post.uid = null;
}
return post;
}
return null;
};

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