forked from MarseyWorld/MarseyWorld
make marsify not count towards /marseys
parent
e2c7e2939f
commit
959e08bb83
|
@ -193,7 +193,7 @@ def with_sigalrm_timeout(timeout: int):
|
|||
|
||||
|
||||
@with_sigalrm_timeout(2)
|
||||
def sanitize(sanitized, edit=False, limit_pings=0, showmore=True):
|
||||
def sanitize(sanitized, edit=False, limit_pings=0, showmore=True, marsified=False):
|
||||
sanitized = sanitized.strip()
|
||||
|
||||
sanitized = normalize_url(sanitized)
|
||||
|
@ -322,7 +322,7 @@ def sanitize(sanitized, edit=False, limit_pings=0, showmore=True):
|
|||
sanitized = video_sub_regex.sub(r'\1<video controls preload="metadata"><source src="\2"></video>', sanitized)
|
||||
sanitized = audio_sub_regex.sub(r'\1<audio controls preload="metadata" src="\2"></audio>', sanitized)
|
||||
|
||||
if not edit:
|
||||
if not edit and not marsified:
|
||||
for marsey in g.db.query(Marsey).filter(Marsey.name.in_(marseys_used)).all():
|
||||
marsey.count += 1
|
||||
g.db.add(marsey)
|
||||
|
|
|
@ -360,7 +360,7 @@ def award_thing(v, thing_type, id):
|
|||
body = thing.body
|
||||
body = owoify(body)
|
||||
if author.marsify: body = marsify(body)
|
||||
thing.body_html = sanitize(body, limit_pings=5)
|
||||
thing.body_html = sanitize(body, limit_pings=5, marsified=True)
|
||||
g.db.add(thing)
|
||||
elif ("Femboy" in kind and kind == v.house) or kind == 'marsify':
|
||||
if author.marsify: author.marsify += 21600
|
||||
|
@ -370,7 +370,7 @@ def award_thing(v, thing_type, id):
|
|||
body = thing.body
|
||||
if author.owoify: body = owoify(body)
|
||||
body = marsify(body)
|
||||
thing.body_html = sanitize(body, limit_pings=5)
|
||||
thing.body_html = sanitize(body, limit_pings=5, marsified=True)
|
||||
g.db.add(thing)
|
||||
|
||||
if author.received_award_count: author.received_award_count += 1
|
||||
|
|
|
@ -341,7 +341,7 @@ def comment(v):
|
|||
if v.marsify:
|
||||
body_for_sanitize = marsify(body_for_sanitize)
|
||||
|
||||
body_html = sanitize(body_for_sanitize, limit_pings=5)
|
||||
body_html = sanitize(body_for_sanitize, limit_pings=5, marsified=True)
|
||||
|
||||
|
||||
if parent_post.id not in ADMIGGERS and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower():
|
||||
|
@ -772,7 +772,7 @@ def edit_comment(cid, v):
|
|||
if v.marsify:
|
||||
body_for_sanitize = marsify(body_for_sanitize)
|
||||
|
||||
body_html = sanitize(body_for_sanitize, edit=True, limit_pings=5)
|
||||
body_html = sanitize(body_for_sanitize, edit=True, limit_pings=5, marsified=True)
|
||||
|
||||
if len(body_html) > 20000: abort(400)
|
||||
|
||||
|
|
Loading…
Reference in New Issue