Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-09-27 00:27:05 +00:00
commit 6687e89e1c
3 changed files with 16 additions and 8 deletions

View File

@ -1013,7 +1013,13 @@ approved_embed_hosts = {
'substackcdn.com',
'9gag.com',
'ifunny.co',
'wixmp.com'
'wixmp.com',
'derpicdn.net',
'twibooru.org',
'ponybooru.org',
'e621.net',
'ponerpics.org',
'furaffinity.net'
}

View File

@ -513,7 +513,7 @@ def subs(v):
return render_template('sub/subs.html', v=v, subs=subs)
@app.post("/hole_pin/<pid>")
@auth_required
@is_not_permabanned
def hole_pin(v, pid):
p = get_post(pid)
@ -531,7 +531,7 @@ def hole_pin(v, pid):
return {"message": f"Post pinned to /h/{p.sub} successfully!"}
@app.post("/hole_unpin/<pid>")
@auth_required
@is_not_permabanned
def hole_unpin(v, pid):
p = get_post(pid)

View File

@ -720,8 +720,10 @@ def song(song):
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def subscribe(v, post_id):
new_sub = Subscription(user_id=v.id, submission_id=post_id)
g.db.add(new_sub)
existing = g.db.query(Subscription).filter_by(user_id=v.id, submission_id=post_id).one_or_none()
if not existing:
new_sub = Subscription(user_id=v.id, submission_id=post_id)
g.db.add(new_sub)
return {"message": "Subscribed to post successfully!"}
@app.post("/unsubscribe/<post_id>")
@ -729,9 +731,9 @@ def subscribe(v, post_id):
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def unsubscribe(v, post_id):
sub=g.db.query(Subscription).filter_by(user_id=v.id, submission_id=post_id).one_or_none()
if sub:
g.db.delete(sub)
existing = g.db.query(Subscription).filter_by(user_id=v.id, submission_id=post_id).one_or_none()
if existing:
g.db.delete(existing)
return {"message": "Unsubscribed from post successfully!"}
@app.post("/@<username>/message")