forked from rDrama/rDrama
master
parent
98afe7d2c3
commit
2028216c45
|
@ -45,6 +45,8 @@ def archive_url(url):
|
||||||
gevent.spawn(_archiveorg, url)
|
gevent.spawn(_archiveorg, url)
|
||||||
|
|
||||||
def execute_snappy(post:Submission, v:User):
|
def execute_snappy(post:Submission, v:User):
|
||||||
|
ghost = post.ghost
|
||||||
|
|
||||||
snappy = get_account(SNAPPY_ID)
|
snappy = get_account(SNAPPY_ID)
|
||||||
|
|
||||||
if post.sub == 'dankchristianmemes' or post.sub == 'truth':
|
if post.sub == 'dankchristianmemes' or post.sub == 'truth':
|
||||||
|
@ -95,6 +97,8 @@ def execute_snappy(post:Submission, v:User):
|
||||||
post.upvotes += 1
|
post.upvotes += 1
|
||||||
elif body == '!slots':
|
elif body == '!slots':
|
||||||
body = f'!slots{snappy.coins}'
|
body = f'!slots{snappy.coins}'
|
||||||
|
elif body.startswith(':#marseyghost'):
|
||||||
|
ghost = True
|
||||||
|
|
||||||
body += "\n\n"
|
body += "\n\n"
|
||||||
|
|
||||||
|
@ -161,7 +165,7 @@ def execute_snappy(post:Submission, v:User):
|
||||||
app_id=None,
|
app_id=None,
|
||||||
body=body,
|
body=body,
|
||||||
body_html=body_html,
|
body_html=body_html,
|
||||||
ghost=post.ghost
|
ghost=ghost
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c)
|
g.db.add(c)
|
||||||
|
|
|
@ -100,10 +100,12 @@ def comment(v:User):
|
||||||
if parent_fullname.startswith("u_"):
|
if parent_fullname.startswith("u_"):
|
||||||
parent = get_account(id, v=v)
|
parent = get_account(id, v=v)
|
||||||
post_target = parent
|
post_target = parent
|
||||||
|
ghost = False
|
||||||
elif parent_fullname.startswith("p_"):
|
elif parent_fullname.startswith("p_"):
|
||||||
parent = get_post(id, v=v)
|
parent = get_post(id, v=v)
|
||||||
post_target = parent
|
post_target = parent
|
||||||
if POLL_THREAD and parent.id == POLL_THREAD and v.admin_level < PERMS['POST_TO_POLL_THREAD']: abort(403)
|
if POLL_THREAD and parent.id == POLL_THREAD and v.admin_level < PERMS['POST_TO_POLL_THREAD']: abort(403)
|
||||||
|
ghost = parent.ghost
|
||||||
elif parent_fullname.startswith("c_"):
|
elif parent_fullname.startswith("c_"):
|
||||||
parent = get_comment(id, v=v)
|
parent = get_comment(id, v=v)
|
||||||
post_target = get_post(parent.parent_submission, v=v, graceful=True) or get_account(parent.wall_user_id, v=v, include_blocks=True, include_shadowbanned=False)
|
post_target = get_post(parent.parent_submission, v=v, graceful=True) or get_account(parent.wall_user_id, v=v, include_blocks=True, include_shadowbanned=False)
|
||||||
|
@ -111,6 +113,7 @@ def comment(v:User):
|
||||||
if parent.author_id == v.id: rts = True
|
if parent.author_id == v.id: rts = True
|
||||||
if not v.can_post_in_ghost_threads and isinstance(post_target, Submission) and post_target.ghost:
|
if not v.can_post_in_ghost_threads and isinstance(post_target, Submission) and post_target.ghost:
|
||||||
abort(403, f"You need {TRUESCORE_GHOST_MINIMUM} truescore to post in ghost threads")
|
abort(403, f"You need {TRUESCORE_GHOST_MINIMUM} truescore to post in ghost threads")
|
||||||
|
ghost = parent.ghost
|
||||||
else: abort(404)
|
else: abort(404)
|
||||||
|
|
||||||
level = 1 if isinstance(parent, (Submission, User)) else int(parent.level) + 1
|
level = 1 if isinstance(parent, (Submission, User)) else int(parent.level) + 1
|
||||||
|
@ -236,7 +239,7 @@ def comment(v:User):
|
||||||
app_id=v.client.application.id if v.client else None,
|
app_id=v.client.application.id if v.client else None,
|
||||||
body_html=body_html,
|
body_html=body_html,
|
||||||
body=body,
|
body=body,
|
||||||
ghost=post_target.ghost if posting_to_submission else False,
|
ghost=ghost,
|
||||||
)
|
)
|
||||||
|
|
||||||
c.upvotes = 1
|
c.upvotes = 1
|
||||||
|
|
Loading…
Reference in New Issue