forked from rDrama/rDrama
Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost
commit
6687e89e1c
|
@ -1013,7 +1013,13 @@ approved_embed_hosts = {
|
||||||
'substackcdn.com',
|
'substackcdn.com',
|
||||||
'9gag.com',
|
'9gag.com',
|
||||||
'ifunny.co',
|
'ifunny.co',
|
||||||
'wixmp.com'
|
'wixmp.com',
|
||||||
|
'derpicdn.net',
|
||||||
|
'twibooru.org',
|
||||||
|
'ponybooru.org',
|
||||||
|
'e621.net',
|
||||||
|
'ponerpics.org',
|
||||||
|
'furaffinity.net'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -513,7 +513,7 @@ def subs(v):
|
||||||
return render_template('sub/subs.html', v=v, subs=subs)
|
return render_template('sub/subs.html', v=v, subs=subs)
|
||||||
|
|
||||||
@app.post("/hole_pin/<pid>")
|
@app.post("/hole_pin/<pid>")
|
||||||
@auth_required
|
@is_not_permabanned
|
||||||
def hole_pin(v, pid):
|
def hole_pin(v, pid):
|
||||||
p = get_post(pid)
|
p = get_post(pid)
|
||||||
|
|
||||||
|
@ -531,7 +531,7 @@ def hole_pin(v, pid):
|
||||||
return {"message": f"Post pinned to /h/{p.sub} successfully!"}
|
return {"message": f"Post pinned to /h/{p.sub} successfully!"}
|
||||||
|
|
||||||
@app.post("/hole_unpin/<pid>")
|
@app.post("/hole_unpin/<pid>")
|
||||||
@auth_required
|
@is_not_permabanned
|
||||||
def hole_unpin(v, pid):
|
def hole_unpin(v, pid):
|
||||||
p = get_post(pid)
|
p = get_post(pid)
|
||||||
|
|
||||||
|
|
|
@ -720,6 +720,8 @@ def song(song):
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
|
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
|
||||||
@auth_required
|
@auth_required
|
||||||
def subscribe(v, post_id):
|
def subscribe(v, post_id):
|
||||||
|
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)
|
new_sub = Subscription(user_id=v.id, submission_id=post_id)
|
||||||
g.db.add(new_sub)
|
g.db.add(new_sub)
|
||||||
return {"message": "Subscribed to post successfully!"}
|
return {"message": "Subscribed to post successfully!"}
|
||||||
|
@ -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")}')
|
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
|
||||||
@auth_required
|
@auth_required
|
||||||
def unsubscribe(v, post_id):
|
def unsubscribe(v, post_id):
|
||||||
sub=g.db.query(Subscription).filter_by(user_id=v.id, submission_id=post_id).one_or_none()
|
existing = g.db.query(Subscription).filter_by(user_id=v.id, submission_id=post_id).one_or_none()
|
||||||
if sub:
|
if existing:
|
||||||
g.db.delete(sub)
|
g.db.delete(existing)
|
||||||
return {"message": "Unsubscribed from post successfully!"}
|
return {"message": "Unsubscribed from post successfully!"}
|
||||||
|
|
||||||
@app.post("/@<username>/message")
|
@app.post("/@<username>/message")
|
||||||
|
|
Loading…
Reference in New Issue