forked from rDrama/rDrama
1
0
Fork 0

disable ghost-posting in holes to prevent hole jannies from unmaking ppl who participate in them

master
Aevann 2023-07-01 03:39:24 +03:00
parent 3cbea18327
commit aaa618657f
3 changed files with 9 additions and 0 deletions

View File

@ -106,11 +106,15 @@ function autoSuggestTitle() {
function ghost_toggle(t) {
const followers = document.getElementById("post-notify")
const sub = document.getElementById("sub")
if (t.checked == true) {
followers.checked = false;
followers.disabled = true;
sub.value = '';
sub.disabled = true;
} else {
followers.disabled = false;
sub.disabled = false;
}
}

View File

@ -585,6 +585,8 @@ def submit_post(v:User, sub=None):
flag_private = request.values.get("private", False, bool)
flag_ghost = request.values.get("ghost", False, bool) and v.can_post_in_ghost_threads
if flag_ghost: sub = None
if embed and len(embed) > 1500: embed = None
if embed: embed = embed.strip()

View File

@ -158,6 +158,9 @@ def remove_report_comment(v, cid, uid):
return {"message": "Report removed successfully!"}
def move_post(post:Post, v:User, reason:str) -> Union[bool, str]:
if post.ghost:
return False
if not reason.startswith('/h/') and not reason.startswith('h/'):
return False