forked from MarseyWorld/MarseyWorld
Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost
commit
129508b163
|
@ -9,6 +9,11 @@ import user_agents
|
|||
import time
|
||||
|
||||
def calc_users(v):
|
||||
# Some globals we expect aren't available when rendering error pages
|
||||
if (not g or not hasattr(g, 'agent')
|
||||
or not session or not ('session_id' in session)):
|
||||
return ''
|
||||
|
||||
loggedin = cache.get(f'{SITE}_loggedin') or {}
|
||||
loggedout = cache.get(f'{SITE}_loggedout') or {}
|
||||
timestamp = int(time.time())
|
||||
|
|
|
@ -255,7 +255,9 @@ def comment(v):
|
|||
if parent.author.any_block_exists(v) and v.admin_level < PERMS['POST_COMMENT_MODERATION']:
|
||||
abort(403, "You can't reply to users who have blocked you or users that you have blocked.")
|
||||
|
||||
is_bot = v.id != BBBB_ID and v.client or (SITE == 'pcmemes.net' and v.id == SNAPPY_ID)
|
||||
is_bot = (v.client is not None
|
||||
and v.id != BBBB_ID
|
||||
or (SITE == 'pcmemes.net' and v.id == SNAPPY_ID))
|
||||
|
||||
execute_antispam_comment_check(body, v)
|
||||
|
||||
|
|
|
@ -877,8 +877,6 @@ def submit_post(v, sub=None):
|
|||
|
||||
if embed and len(embed) > 1500: embed = None
|
||||
|
||||
is_bot = v.id != BBBB_ID and v.client or (SITE == 'pcmemes.net' and v.id == SNAPPY_ID)
|
||||
|
||||
if request.values.get("ghost") and v.coins >= 100:
|
||||
v.charge_account('coins', 100)
|
||||
ghost = True
|
||||
|
@ -894,7 +892,7 @@ def submit_post(v, sub=None):
|
|||
over_18=bool(request.values.get("over_18","")),
|
||||
new=bool(request.values.get("new","")),
|
||||
app_id=v.client.application.id if v.client else None,
|
||||
is_bot = is_bot,
|
||||
is_bot=(v.client is not None),
|
||||
url=url,
|
||||
body=body,
|
||||
body_html=body_html,
|
||||
|
|
|
@ -913,7 +913,7 @@ def u_username_comments(username, v=None):
|
|||
|
||||
listing = get_comments(ids, v=v)
|
||||
|
||||
if v.client or request.path.endswith(".json"):
|
||||
if (v and v.client) or request.path.endswith(".json"):
|
||||
return {"data": [c.json for c in listing]}
|
||||
|
||||
return render_template("userpage_comments.html", u=user, v=v, listing=listing, page=page, sort=sort, t=t,next_exists=next_exists, is_following=is_following, standalone=True)
|
||||
|
|
Loading…
Reference in New Issue