feat: #6021 add min:rep-post-links (#11938)

new reputation limit to post links
if post queue is enabled and user doesn't have enough reputation to post links, queue their posts

if post queue is NOT enabled and user doesn't have enough reputation to post links show error

check content on topic post, topic reply, post edit
This commit is contained in:
Barış Soner Uşaklı
2023-08-21 14:00:36 -04:00
committed by GitHub
parent c989a4a328
commit 979f24b173
7 changed files with 39 additions and 1 deletions

View File

@@ -99,6 +99,8 @@ postsAPI.edit = async function (caller, data) {
throw new Error(`[[error:content-too-short, ${meta.config.minimumPostLength}]]`);
} else if (contentLen > meta.config.maximumPostLength) {
throw new Error(`[[error:content-too-long, ${meta.config.maximumPostLength}]]`);
} else if (!await posts.canUserPostContentWithLinks(caller.uid, data.content)) {
throw new Error(`[[error:not-enough-reputation-to-post-links, ${meta.config['min:rep:post-links']}]]`);
}
data.uid = caller.uid;