parent
98a0f37e59
commit
bb153e541d
|
@ -1000,7 +1000,7 @@ class User(Base):
|
||||||
if not cls.can_see(user, other.author): return False
|
if not cls.can_see(user, other.author): return False
|
||||||
if user and user.id == other.author_id: return True
|
if user and user.id == other.author_id: return True
|
||||||
if isinstance(other, Submission):
|
if isinstance(other, Submission):
|
||||||
if "!YOU!" in other.title and not user.can_see_you_post: return False
|
if "!YOU!" in other.title and not (user and (user.client or user.truescore > 5000)): return False
|
||||||
if other.sub and not cls.can_see(user, other.subr): return False
|
if other.sub and not cls.can_see(user, other.subr): return False
|
||||||
else:
|
else:
|
||||||
if not other.parent_submission:
|
if not other.parent_submission:
|
||||||
|
@ -1029,19 +1029,10 @@ class User(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def can_post_in_ghost_threads(self):
|
def can_post_in_ghost_threads(self):
|
||||||
if not TRUESCORE_GHOST_MINIMUM: return True
|
if not TRUESCORE_GHOST_LIMIT: return True
|
||||||
if self.admin_level >= PERMS['POST_IN_GHOST_THREADS']: return True
|
if self.admin_level >= PERMS['POST_IN_GHOST_THREADS']: return True
|
||||||
if self.club_allowed: return True
|
if self.club_allowed: return True
|
||||||
if self.truescore >= TRUESCORE_GHOST_MINIMUM: return True
|
if self.truescore >= TRUESCORE_GHOST_LIMIT: return True
|
||||||
if self.patron: return True
|
|
||||||
if self.client: return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
|
||||||
@lazy
|
|
||||||
def can_see_you_post(self):
|
|
||||||
if not TRUESCORE_YOU_POST_MINIMUM: return True
|
|
||||||
if self.truescore >= TRUESCORE_YOU_POST_MINIMUM: return True
|
|
||||||
if self.patron: return True
|
if self.patron: return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -390,9 +390,8 @@ MIN_REPOST_CHECK_URL_LENGTH = 9 # also change the constant in checkRepost() of s
|
||||||
CHAT_LENGTH_LIMIT = 1000
|
CHAT_LENGTH_LIMIT = 1000
|
||||||
TRUESCORE_DONATE_LIMIT = 100
|
TRUESCORE_DONATE_LIMIT = 100
|
||||||
COSMETIC_AWARD_COIN_AWARD_PCT = 0.10
|
COSMETIC_AWARD_COIN_AWARD_PCT = 0.10
|
||||||
TRUESCORE_CHAT_MINIMUM = 0
|
TRUESCORE_CHAT_LIMIT = 0
|
||||||
TRUESCORE_GHOST_MINIMUM = 0
|
TRUESCORE_GHOST_LIMIT = 0
|
||||||
TRUESCORE_YOU_POST_MINIMUM = 0
|
|
||||||
|
|
||||||
LOGGEDIN_ACTIVE_TIME = 15 * 60
|
LOGGEDIN_ACTIVE_TIME = 15 * 60
|
||||||
PFP_DEFAULT_MARSEY = True
|
PFP_DEFAULT_MARSEY = True
|
||||||
|
@ -495,9 +494,8 @@ if SITE == 'rdrama.net':
|
||||||
NOTIFICATION_THREAD = 6489
|
NOTIFICATION_THREAD = 6489
|
||||||
|
|
||||||
CHAT_LENGTH_LIMIT = 200
|
CHAT_LENGTH_LIMIT = 200
|
||||||
TRUESCORE_CHAT_MINIMUM = 10
|
TRUESCORE_CHAT_LIMIT = 10
|
||||||
TRUESCORE_GHOST_MINIMUM = 10
|
TRUESCORE_GHOST_LIMIT = 10
|
||||||
TRUESCORE_YOU_POST_MINIMUM = 5000
|
|
||||||
NEW_USER_HAT_AGE = 7 * 86400
|
NEW_USER_HAT_AGE = 7 * 86400
|
||||||
|
|
||||||
HOLE_COST = 50000
|
HOLE_COST = 50000
|
||||||
|
@ -573,8 +571,6 @@ elif SITE == 'pcmemes.net':
|
||||||
ERROR_MARSEYS[500] = "wholesome"
|
ERROR_MARSEYS[500] = "wholesome"
|
||||||
POST_RATE_LIMIT = '1/second;4/minute;20/hour;100/day'
|
POST_RATE_LIMIT = '1/second;4/minute;20/hour;100/day'
|
||||||
|
|
||||||
TRUESCORE_YOU_POST_MINIMUM = 5000
|
|
||||||
|
|
||||||
HOLE_COST = 2000
|
HOLE_COST = 2000
|
||||||
|
|
||||||
AUTOJANNY_ID = 1046
|
AUTOJANNY_ID = 1046
|
||||||
|
@ -633,9 +629,8 @@ elif SITE == 'watchpeopledie.tv':
|
||||||
SIDEBAR_THREAD = 5403
|
SIDEBAR_THREAD = 5403
|
||||||
BANNER_THREAD = 9869
|
BANNER_THREAD = 9869
|
||||||
|
|
||||||
TRUESCORE_CHAT_MINIMUM = 10
|
TRUESCORE_CHAT_LIMIT = 10
|
||||||
TRUESCORE_GHOST_MINIMUM = 10
|
TRUESCORE_GHOST_LIMIT = 10
|
||||||
TRUESCORE_YOU_POST_MINIMUM = 5000
|
|
||||||
|
|
||||||
HOLE_NAME = 'flair'
|
HOLE_NAME = 'flair'
|
||||||
HOLE_STYLE_FLAIR = True
|
HOLE_STYLE_FLAIR = True
|
||||||
|
|
|
@ -39,8 +39,8 @@ user_ids_to_socket_ids = {}
|
||||||
@app.get("/chat")
|
@app.get("/chat")
|
||||||
@is_not_permabanned
|
@is_not_permabanned
|
||||||
def chat(v):
|
def chat(v):
|
||||||
if TRUESCORE_CHAT_MINIMUM and v.truescore < TRUESCORE_CHAT_MINIMUM and not v.club_allowed:
|
if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT and not v.club_allowed:
|
||||||
abort(403, f"Need at least {TRUESCORE_CHAT_MINIMUM} truescore for access to chat.")
|
abort(403, f"Need at least {TRUESCORE_CHAT_LIMIT} truescore for access to chat.")
|
||||||
return render_template("chat.html", v=v, messages=messages)
|
return render_template("chat.html", v=v, messages=messages)
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ def chat(v):
|
||||||
@ratelimit_user("3/second;10/minute")
|
@ratelimit_user("3/second;10/minute")
|
||||||
def speak(data, v):
|
def speak(data, v):
|
||||||
if v.is_banned: return '', 403
|
if v.is_banned: return '', 403
|
||||||
if TRUESCORE_CHAT_MINIMUM and v.truescore < TRUESCORE_CHAT_MINIMUM and not v.club_allowed: return '', 403
|
if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT and not v.club_allowed: return '', 403
|
||||||
|
|
||||||
vname = v.username.lower()
|
vname = v.username.lower()
|
||||||
if vname in muted and not v.admin_level >= PERMS['CHAT_BYPASS_MUTE']:
|
if vname in muted and not v.admin_level >= PERMS['CHAT_BYPASS_MUTE']:
|
||||||
|
|
|
@ -101,7 +101,7 @@ def comment(v):
|
||||||
parent_post = get_post(parent.parent_submission, v=v)
|
parent_post = get_post(parent.parent_submission, v=v)
|
||||||
parent_comment_id = parent.id
|
parent_comment_id = parent.id
|
||||||
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 parent_post.ghost: abort(403, f"You need {TRUESCORE_GHOST_MINIMUM} truescore to post in ghost threads")
|
if not v.can_post_in_ghost_threads and parent_post.ghost: abort(403, f"You need {TRUESCORE_GHOST_LIMIT} truescore to post in ghost threads")
|
||||||
else: abort(400)
|
else: abort(400)
|
||||||
|
|
||||||
level = 1 if isinstance(parent, Submission) else parent.level + 1
|
level = 1 if isinstance(parent, Submission) else parent.level + 1
|
||||||
|
|
Loading…
Reference in New Issue