fdssfd
This commit is contained in:
parent
245bf4778a
commit
ea91371c04
16 changed files with 177 additions and 231 deletions
|
@ -37,7 +37,6 @@ class Comment(Base):
|
||||||
is_bot = Column(Boolean, default=False)
|
is_bot = Column(Boolean, default=False)
|
||||||
is_pinned = Column(String)
|
is_pinned = Column(String)
|
||||||
sentto=Column(Integer, ForeignKey("users.id"))
|
sentto=Column(Integer, ForeignKey("users.id"))
|
||||||
notifiedto=Column(Integer)
|
|
||||||
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
|
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
|
||||||
oauth_app = relationship("OauthApp", viewonly=True)
|
oauth_app = relationship("OauthApp", viewonly=True)
|
||||||
upvotes = Column(Integer, default=1)
|
upvotes = Column(Integer, default=1)
|
||||||
|
@ -98,6 +97,7 @@ class Comment(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def age_string(self):
|
def age_string(self):
|
||||||
|
if not self.created_utc: return None
|
||||||
|
|
||||||
age = int(time.time()) - self.created_utc
|
age = int(time.time()) - self.created_utc
|
||||||
|
|
||||||
|
@ -416,12 +416,6 @@ class Notification(Base):
|
||||||
user_id = Column(Integer, ForeignKey("users.id"))
|
user_id = Column(Integer, ForeignKey("users.id"))
|
||||||
comment_id = Column(Integer, ForeignKey("comments.id"))
|
comment_id = Column(Integer, ForeignKey("comments.id"))
|
||||||
read = Column(Boolean, default=False)
|
read = Column(Boolean, default=False)
|
||||||
followsender = Column(Integer)
|
|
||||||
unfollowsender = Column(Integer)
|
|
||||||
removefollowsender = Column(Integer)
|
|
||||||
blocksender = Column(Integer)
|
|
||||||
unblocksender = Column(Integer)
|
|
||||||
|
|
||||||
comment = relationship("Comment", viewonly=True)
|
comment = relationship("Comment", viewonly=True)
|
||||||
user = relationship("User", viewonly=True)
|
user = relationship("User", viewonly=True)
|
||||||
|
|
||||||
|
|
|
@ -6,108 +6,69 @@ from .markdown import *
|
||||||
from .sanitize import *
|
from .sanitize import *
|
||||||
from .const import *
|
from .const import *
|
||||||
|
|
||||||
|
def send_repeatable_notification(uid, text, autojanny=False):
|
||||||
def send_notification(uid, text, autojanny=False):
|
|
||||||
|
|
||||||
text = text.replace('r/', 'r\/').replace('u/', 'u\/')
|
text = text.replace('r/', 'r\/').replace('u/', 'u\/')
|
||||||
text_html = CustomRenderer().render(mistletoe.Document(text))
|
|
||||||
text_html = sanitize(text_html)
|
|
||||||
|
|
||||||
if autojanny: author_id = AUTOJANNY_ID
|
if autojanny: author_id = AUTOJANNY_ID
|
||||||
else:
|
else: author_id = NOTIFICATIONS_ID
|
||||||
author_id = NOTIFICATIONS_ID
|
|
||||||
if ' has gifted you ' not in text:
|
|
||||||
existing = g.db.query(Comment.id).filter(Comment.author_id == author_id, Comment.body_html == text_html, Comment.notifiedto == uid).first()
|
|
||||||
if existing: return
|
|
||||||
|
|
||||||
|
existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, distinguish_level=6, body=text, created_utc=0).first()
|
||||||
|
if existing:
|
||||||
|
existing2 = g.db.query(Notification.id).filter_by(user_id=uid, comment_id=existing[0]).first()
|
||||||
|
if existing2:
|
||||||
|
text_html = sanitize(CustomRenderer().render(mistletoe.Document(text)))
|
||||||
new_comment = Comment(author_id=author_id,
|
new_comment = Comment(author_id=author_id,
|
||||||
parent_submission=None,
|
parent_submission=None,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
|
body=text,
|
||||||
body_html=text_html,
|
body_html=text_html,
|
||||||
notifiedto=uid
|
created_utc=0)
|
||||||
)
|
|
||||||
g.db.add(new_comment)
|
g.db.add(new_comment)
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
notif = Notification(comment_id=new_comment.id, user_id=uid)
|
notif = Notification(comment_id=new_comment.id, user_id=uid)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
return
|
||||||
|
|
||||||
|
send_notification(uid, text, autojanny)
|
||||||
|
|
||||||
|
|
||||||
def send_follow_notif(vid, user, text):
|
def send_notification(uid, text, autojanny=False):
|
||||||
|
|
||||||
text_html = CustomRenderer().render(mistletoe.Document(text))
|
cid = notif_comment(text, autojanny)
|
||||||
text_html = sanitize(text_html)
|
add_notif(cid, uid)
|
||||||
|
|
||||||
new_comment = Comment(author_id=NOTIFICATIONS_ID,
|
|
||||||
|
def notif_comment(text, autojanny=False):
|
||||||
|
|
||||||
|
text = text.replace('r/', 'r\/').replace('u/', 'u\/')
|
||||||
|
|
||||||
|
if autojanny: author_id = AUTOJANNY_ID
|
||||||
|
else: author_id = NOTIFICATIONS_ID
|
||||||
|
|
||||||
|
existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, distinguish_level=6, body=text, created_utc=0).first()
|
||||||
|
|
||||||
|
if existing: cid = existing[0]
|
||||||
|
else:
|
||||||
|
text_html = sanitize(CustomRenderer().render(mistletoe.Document(text)))
|
||||||
|
new_comment = Comment(author_id=author_id,
|
||||||
parent_submission=None,
|
parent_submission=None,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
|
body=text,
|
||||||
body_html=text_html,
|
body_html=text_html,
|
||||||
)
|
created_utc=0)
|
||||||
g.db.add(new_comment)
|
g.db.add(new_comment)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
cid = new_comment.id
|
||||||
|
|
||||||
notif = Notification(comment_id=new_comment.id,
|
return cid
|
||||||
user_id=user,
|
|
||||||
followsender=vid)
|
def add_notif(cid, uid):
|
||||||
|
existing = g.db.query(Notification.id).filter_by(comment_id=cid, user_id=uid).first()
|
||||||
|
if not existing:
|
||||||
|
notif = Notification(comment_id=cid, user_id=uid)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
def send_unfollow_notif(vid, user, text):
|
|
||||||
|
|
||||||
text_html = CustomRenderer().render(mistletoe.Document(text))
|
|
||||||
text_html = sanitize(text_html)
|
|
||||||
|
|
||||||
new_comment = Comment(author_id=NOTIFICATIONS_ID,
|
|
||||||
parent_submission=None,
|
|
||||||
distinguish_level=6,
|
|
||||||
body_html=text_html,
|
|
||||||
)
|
|
||||||
g.db.add(new_comment)
|
|
||||||
g.db.flush()
|
|
||||||
|
|
||||||
notif = Notification(comment_id=new_comment.id,
|
|
||||||
user_id=user,
|
|
||||||
unfollowsender=vid)
|
|
||||||
g.db.add(notif)
|
|
||||||
|
|
||||||
def send_block_notif(vid, user, text):
|
|
||||||
|
|
||||||
text_html = CustomRenderer().render(mistletoe.Document(text))
|
|
||||||
text_html = sanitize(text_html)
|
|
||||||
|
|
||||||
new_comment = Comment(author_id=NOTIFICATIONS_ID,
|
|
||||||
parent_submission=None,
|
|
||||||
distinguish_level=6,
|
|
||||||
body_html=text_html,
|
|
||||||
)
|
|
||||||
g.db.add(new_comment)
|
|
||||||
g.db.flush()
|
|
||||||
|
|
||||||
notif = Notification(comment_id=new_comment.id,
|
|
||||||
user_id=user,
|
|
||||||
blocksender=vid)
|
|
||||||
g.db.add(notif)
|
|
||||||
|
|
||||||
def send_unblock_notif(vid, user, text):
|
|
||||||
|
|
||||||
text_html = CustomRenderer().render(mistletoe.Document(text))
|
|
||||||
text_html = sanitize(text_html)
|
|
||||||
|
|
||||||
new_comment = Comment(author_id=NOTIFICATIONS_ID,
|
|
||||||
parent_submission=None,
|
|
||||||
distinguish_level=6,
|
|
||||||
body_html=text_html,
|
|
||||||
)
|
|
||||||
g.db.add(new_comment)
|
|
||||||
g.db.flush()
|
|
||||||
|
|
||||||
notif = Notification(comment_id=new_comment.id,
|
|
||||||
user_id=user,
|
|
||||||
unblocksender=vid)
|
|
||||||
g.db.add(notif)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def send_admin(vid, text):
|
def send_admin(vid, text):
|
||||||
|
|
||||||
text_html = Renderer().render(mistletoe.Document(text))
|
text_html = Renderer().render(mistletoe.Document(text))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from .get import *
|
from .get import *
|
||||||
from .alerts import send_notification
|
from .alerts import *
|
||||||
from files.helpers.const import *
|
from files.helpers.const import *
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,12 @@ from flask import *
|
||||||
from files.__main__ import app, cache, limiter
|
from files.__main__ import app, cache, limiter
|
||||||
from .front import frontlist
|
from .front import frontlist
|
||||||
from files.helpers.discord import add_role
|
from files.helpers.discord import add_role
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||||
if SITE_NAME == 'PCM': cc = "splash mountain"
|
if SITE_NAME == 'PCM': cc = "splash mountain"
|
||||||
else: cc = "country club"
|
else: cc = "country club"
|
||||||
|
month = datetime.now().strftime('%B')
|
||||||
|
|
||||||
@app.get("/distribute/<cid>")
|
@app.get("/distribute/<cid>")
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
|
@ -30,16 +32,16 @@ def distribute(v, cid):
|
||||||
votes = g.db.query(CommentVote).filter_by(comment_id=cid)
|
votes = g.db.query(CommentVote).filter_by(comment_id=cid)
|
||||||
autobetter = g.db.query(User).filter_by(id=AUTOBETTER_ID).first()
|
autobetter = g.db.query(User).filter_by(id=AUTOBETTER_ID).first()
|
||||||
coinsperperson = int(autobetter.coins / votes.count())
|
coinsperperson = int(autobetter.coins / votes.count())
|
||||||
|
cid = notif_comment(f"You won {coinsperperson} coins betting on [{post}]({post}) !")
|
||||||
for vote in votes:
|
for vote in votes:
|
||||||
u = vote.user
|
u = vote.user
|
||||||
u.coins += coinsperperson
|
u.coins += coinsperperson
|
||||||
send_notification(u.id, f"You won {coinsperperson} coins betting on {post} !")
|
add_notif(cid, u.id)
|
||||||
g.db.add(u)
|
|
||||||
|
|
||||||
autobetter.coins = 0
|
autobetter.coins = 0
|
||||||
g.db.add(autobetter)
|
g.db.add(autobetter)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return str(coinsperperson)
|
return f"Each winner has received {coinsperperson} coins!"
|
||||||
|
|
||||||
@app.get("/truescore")
|
@app.get("/truescore")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
|
@ -199,17 +201,19 @@ def remove_meme_admin(v, username):
|
||||||
def monthly(v):
|
def monthly(v):
|
||||||
if 'pcm' in request.host or (SITE_NAME == 'Drama' and v.admin_level > 2) or ('rama' not in request.host and 'pcm' not in request.host):
|
if 'pcm' in request.host or (SITE_NAME == 'Drama' and v.admin_level > 2) or ('rama' not in request.host and 'pcm' not in request.host):
|
||||||
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
|
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
|
||||||
|
|
||||||
for u in g.db.query(User).filter(User.patron > 0).all():
|
for u in g.db.query(User).filter(User.patron > 0).all():
|
||||||
if u.patron == 1: procoins = 2500
|
if u.patron == 1: procoins = 2500
|
||||||
elif u.patron == 2: procoins = 5000
|
elif u.patron == 2: procoins = 5000
|
||||||
elif u.patron == 3: procoins = 10000
|
elif u.patron == 3: procoins = 10000
|
||||||
elif u.patron == 4: procoins = 25000
|
elif u.patron == 4: procoins = 25000
|
||||||
elif u.patron == 5: procoins = 50000
|
elif u.patron == 5: procoins = 50000
|
||||||
|
|
||||||
u.procoins += procoins
|
u.procoins += procoins
|
||||||
send_notification(u.id, f"You were given {procoins} Marseybux! You can use them to buy awards in the [shop](/shop).")
|
|
||||||
g.db.add(u)
|
g.db.add(u)
|
||||||
|
|
||||||
|
cid = notif_comment(f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).")
|
||||||
|
add_notif(cid, u.id)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Monthly coins granted"}
|
return {"message": "Monthly coins granted"}
|
||||||
|
|
||||||
|
@ -677,8 +681,8 @@ def agendaposter(user_id, v):
|
||||||
badge = user.has_badge(26)
|
badge = user.has_badge(26)
|
||||||
if badge: g.db.delete(badge)
|
if badge: g.db.delete(badge)
|
||||||
|
|
||||||
if user.agendaposter: send_notification(user.id, f"You have been marked by an admin as an agendaposter ({note}).")
|
if user.agendaposter: send_repeatable_notification(user.id, f"You have been marked by an admin as an agendaposter ({note}).")
|
||||||
else: send_notification(user.id, f"You have been unmarked by an admin as an agendaposter.")
|
else: send_repeatable_notification(user.id, f"You have been unmarked by an admin as an agendaposter.")
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
if user.agendaposter: return redirect(user.url)
|
if user.agendaposter: return redirect(user.url)
|
||||||
|
@ -839,7 +843,7 @@ def ban_user(user_id, v):
|
||||||
if message: text = f"Your account has been permanently suspended for the following reason:\n\n> {message}"
|
if message: text = f"Your account has been permanently suspended for the following reason:\n\n> {message}"
|
||||||
else: text = "Your account has been permanently suspended."
|
else: text = "Your account has been permanently suspended."
|
||||||
|
|
||||||
send_notification(user.id, text)
|
send_repeatable_notification(user.id, text)
|
||||||
|
|
||||||
if days == 0: duration = "permanent"
|
if days == 0: duration = "permanent"
|
||||||
elif days == 1: duration = "1 day"
|
elif days == 1: duration = "1 day"
|
||||||
|
@ -893,7 +897,7 @@ def unban_user(user_id, v):
|
||||||
x.ban_evade = 0
|
x.ban_evade = 0
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
|
|
||||||
send_notification(user.id,
|
send_repeatable_notification(user.id,
|
||||||
"Your account has been reinstated. Please carefully review and abide by the [rules](/post/2510) to ensure that you don't get suspended again.")
|
"Your account has been reinstated. Please carefully review and abide by the [rules](/post/2510) to ensure that you don't get suspended again.")
|
||||||
|
|
||||||
ma=ModAction(
|
ma=ModAction(
|
||||||
|
@ -1033,13 +1037,13 @@ def api_sticky_post(post_id, v):
|
||||||
if post.stickied:
|
if post.stickied:
|
||||||
if v.id != post.author_id:
|
if v.id != post.author_id:
|
||||||
message = f"@{v.username} has pinned your [post](/post/{post_id})!"
|
message = f"@{v.username} has pinned your [post](/post/{post_id})!"
|
||||||
send_notification(post.author_id, message)
|
send_repeatable_notification(post.author_id, message)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Post pinned!"}
|
return {"message": "Post pinned!"}
|
||||||
else:
|
else:
|
||||||
if v.id != post.author_id:
|
if v.id != post.author_id:
|
||||||
message = f"@{v.username} has unpinned your [post](/post/{post_id})!"
|
message = f"@{v.username} has unpinned your [post](/post/{post_id})!"
|
||||||
send_notification(post.author_id, message)
|
send_repeatable_notification(post.author_id, message)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Post unpinned!"}
|
return {"message": "Post unpinned!"}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ def buy(v, award):
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
if award == "lootbox":
|
if award == "lootbox":
|
||||||
send_notification(995, f"@{v.username} bought a lootbox!")
|
send_repeatable_notification(995, f"@{v.username} bought a lootbox!")
|
||||||
for i in [1,2,3,4,5]:
|
for i in [1,2,3,4,5]:
|
||||||
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
|
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
|
||||||
thing += 1
|
thing += 1
|
||||||
|
@ -212,7 +212,7 @@ def award_post(pid, v):
|
||||||
note = request.values.get("note", "").strip()
|
note = request.values.get("note", "").strip()
|
||||||
if note: msg += f"\n\n> {note}"
|
if note: msg += f"\n\n> {note}"
|
||||||
|
|
||||||
send_notification(post.author.id, msg)
|
send_repeatable_notification(post.author.id, msg)
|
||||||
|
|
||||||
author = post.author
|
author = post.author
|
||||||
if kind == "ban":
|
if kind == "ban":
|
||||||
|
@ -220,26 +220,26 @@ def award_post(pid, v):
|
||||||
|
|
||||||
if not author.is_suspended:
|
if not author.is_suspended:
|
||||||
author.ban(reason=f"1-Day ban award used by @{v.username} on /post/{post.id}", days=1)
|
author.ban(reason=f"1-Day ban award used by @{v.username} on /post/{post.id}", days=1)
|
||||||
send_notification(author.id, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
send_repeatable_notification(author.id, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
||||||
elif author.unban_utc > 0:
|
elif author.unban_utc > 0:
|
||||||
author.unban_utc += 86400
|
author.unban_utc += 86400
|
||||||
send_notification(author.id, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
send_repeatable_notification(author.id, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
||||||
elif kind == "unban":
|
elif kind == "unban":
|
||||||
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
|
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
|
||||||
|
|
||||||
if author.unban_utc - time.time() > 86400:
|
if author.unban_utc - time.time() > 86400:
|
||||||
author.unban_utc -= 86400
|
author.unban_utc -= 86400
|
||||||
send_notification(author.id, f"Your ban duration has been reduced by 1 day!")
|
send_repeatable_notification(author.id, f"Your ban duration has been reduced by 1 day!")
|
||||||
else:
|
else:
|
||||||
author.unban_utc = 0
|
author.unban_utc = 0
|
||||||
author.is_banned = 0
|
author.is_banned = 0
|
||||||
author.ban_evade = 0
|
author.ban_evade = 0
|
||||||
send_notification(author.id, f"You have been unbanned!")
|
send_repeatable_notification(author.id, f"You have been unbanned!")
|
||||||
elif kind == "grass":
|
elif kind == "grass":
|
||||||
author.is_banned = AUTOJANNY_ID
|
author.is_banned = AUTOJANNY_ID
|
||||||
author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}"
|
author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}"
|
||||||
link = f"[this post]({post.permalink})"
|
link = f"[this post]({post.permalink})"
|
||||||
send_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
||||||
elif kind == "pin":
|
elif kind == "pin":
|
||||||
if post.stickied and post.stickied.startswith("t:"): t = int(post.stickied[2:]) + 3600
|
if post.stickied and post.stickied.startswith("t:"): t = int(post.stickied[2:]) + 3600
|
||||||
else: t = int(time.time()) + 3600
|
else: t = int(time.time()) + 3600
|
||||||
|
@ -270,13 +270,13 @@ def award_post(pid, v):
|
||||||
author.flairchanged = time.time() + 86400
|
author.flairchanged = time.time() + 86400
|
||||||
elif kind == "pause":
|
elif kind == "pause":
|
||||||
author.mute = True
|
author.mute = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(68):
|
if not author.has_badge(68):
|
||||||
new_badge = Badge(badge_id=68, user_id=author.id)
|
new_badge = Badge(badge_id=68, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "unpausable":
|
elif kind == "unpausable":
|
||||||
author.unmutable = True
|
author.unmutable = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(67):
|
if not author.has_badge(67):
|
||||||
new_badge = Badge(badge_id=67, user_id=author.id)
|
new_badge = Badge(badge_id=67, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
|
@ -288,7 +288,7 @@ def award_post(pid, v):
|
||||||
return {"error": "This user is the under the effect of a conflicting award: Bird Site award."}, 404
|
return {"error": "This user is the under the effect of a conflicting award: Bird Site award."}, 404
|
||||||
if author.longpost: author.longpost += 86400
|
if author.longpost: author.longpost += 86400
|
||||||
else: author.longpost = time.time() + 86400
|
else: author.longpost = time.time() + 86400
|
||||||
send_notification(IDIO_ID, f"@{v.username} used {kind} award on [{post.shortlink}]({post.shortlink})")
|
send_repeatable_notification(IDIO_ID, f"@{v.username} used {kind} award on [{post.shortlink}]({post.shortlink})")
|
||||||
elif kind == "bird":
|
elif kind == "bird":
|
||||||
if author.longpost:
|
if author.longpost:
|
||||||
return {"error": "This user is the under the effect of a conflicting award: Pizzashill award."}, 404
|
return {"error": "This user is the under the effect of a conflicting award: Pizzashill award."}, 404
|
||||||
|
@ -296,32 +296,32 @@ def award_post(pid, v):
|
||||||
else: author.bird = time.time() + 86400
|
else: author.bird = time.time() + 86400
|
||||||
elif kind == "eye":
|
elif kind == "eye":
|
||||||
author.eye = True
|
author.eye = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(83):
|
if not author.has_badge(83):
|
||||||
new_badge = Badge(badge_id=83, user_id=author.id)
|
new_badge = Badge(badge_id=83, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "alt":
|
elif kind == "alt":
|
||||||
author.alt = True
|
author.alt = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(84):
|
if not author.has_badge(84):
|
||||||
new_badge = Badge(badge_id=84, user_id=author.id)
|
new_badge = Badge(badge_id=84, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "unblockable":
|
elif kind == "unblockable":
|
||||||
author.unblockable = True
|
author.unblockable = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(87):
|
if not author.has_badge(87):
|
||||||
new_badge = Badge(badge_id=87, user_id=author.id)
|
new_badge = Badge(badge_id=87, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
|
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
|
||||||
elif kind == "fish":
|
elif kind == "fish":
|
||||||
author.fish = True
|
author.fish = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(90):
|
if not author.has_badge(90):
|
||||||
new_badge = Badge(badge_id=90, user_id=author.id)
|
new_badge = Badge(badge_id=90, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "grinch":
|
elif kind == "grinch":
|
||||||
author.grinch = True
|
author.grinch = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(91):
|
if not author.has_badge(91):
|
||||||
new_badge = Badge(badge_id=91, user_id=author.id)
|
new_badge = Badge(badge_id=91, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
|
@ -383,7 +383,7 @@ def award_comment(cid, v):
|
||||||
note = request.values.get("note", "").strip()
|
note = request.values.get("note", "").strip()
|
||||||
if note: msg += f"\n\n> {note}"
|
if note: msg += f"\n\n> {note}"
|
||||||
|
|
||||||
send_notification(c.author.id, msg)
|
send_repeatable_notification(c.author.id, msg)
|
||||||
author = c.author
|
author = c.author
|
||||||
|
|
||||||
if kind == "ban":
|
if kind == "ban":
|
||||||
|
@ -391,26 +391,26 @@ def award_comment(cid, v):
|
||||||
|
|
||||||
if not author.is_suspended:
|
if not author.is_suspended:
|
||||||
author.ban(reason=f"1-Day ban award used by @{v.username} on /comment/{c.id}", days=1)
|
author.ban(reason=f"1-Day ban award used by @{v.username} on /comment/{c.id}", days=1)
|
||||||
send_notification(author.id, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
send_repeatable_notification(author.id, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
||||||
elif author.unban_utc > 0:
|
elif author.unban_utc > 0:
|
||||||
author.unban_utc += 86400
|
author.unban_utc += 86400
|
||||||
send_notification(author.id, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
send_repeatable_notification(author.id, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
||||||
elif kind == "unban":
|
elif kind == "unban":
|
||||||
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
|
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
|
||||||
|
|
||||||
if author.unban_utc - time.time() > 86400:
|
if author.unban_utc - time.time() > 86400:
|
||||||
author.unban_utc -= 86400
|
author.unban_utc -= 86400
|
||||||
send_notification(author.id, f"Your ban duration has been reduced by 1 day!")
|
send_repeatable_notification(author.id, f"Your ban duration has been reduced by 1 day!")
|
||||||
else:
|
else:
|
||||||
author.unban_utc = 0
|
author.unban_utc = 0
|
||||||
author.is_banned = 0
|
author.is_banned = 0
|
||||||
author.ban_evade = 0
|
author.ban_evade = 0
|
||||||
send_notification(author.id, f"You have been unbanned!")
|
send_repeatable_notification(author.id, f"You have been unbanned!")
|
||||||
elif kind == "grass":
|
elif kind == "grass":
|
||||||
author.is_banned = AUTOJANNY_ID
|
author.is_banned = AUTOJANNY_ID
|
||||||
author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}"
|
author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}"
|
||||||
link = f"[this comment]({c.permalink})"
|
link = f"[this comment]({c.permalink})"
|
||||||
send_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
||||||
elif kind == "pin":
|
elif kind == "pin":
|
||||||
if c.is_pinned and c.is_pinned.startswith("t:"): t = int(c.is_pinned[2:]) + 3600
|
if c.is_pinned and c.is_pinned.startswith("t:"): t = int(c.is_pinned[2:]) + 3600
|
||||||
else: t = int(time.time()) + 3600
|
else: t = int(time.time()) + 3600
|
||||||
|
@ -438,13 +438,13 @@ def award_comment(cid, v):
|
||||||
author.flairchanged = time.time() + 86400
|
author.flairchanged = time.time() + 86400
|
||||||
elif kind == "pause":
|
elif kind == "pause":
|
||||||
author.mute = True
|
author.mute = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(68):
|
if not author.has_badge(68):
|
||||||
new_badge = Badge(badge_id=68, user_id=author.id)
|
new_badge = Badge(badge_id=68, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "unpausable":
|
elif kind == "unpausable":
|
||||||
author.unmutable = True
|
author.unmutable = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(67):
|
if not author.has_badge(67):
|
||||||
new_badge = Badge(badge_id=67, user_id=author.id)
|
new_badge = Badge(badge_id=67, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
|
@ -456,7 +456,7 @@ def award_comment(cid, v):
|
||||||
return {"error": "This user is the under the effect of a conflicting award: Bird Site award."}, 404
|
return {"error": "This user is the under the effect of a conflicting award: Bird Site award."}, 404
|
||||||
if author.longpost: author.longpost += 86400
|
if author.longpost: author.longpost += 86400
|
||||||
else: author.longpost = time.time() + 86400
|
else: author.longpost = time.time() + 86400
|
||||||
send_notification(IDIO_ID, f"@{v.username} used {kind} award on [{c.shortlink}]({c.shortlink})")
|
send_repeatable_notification(IDIO_ID, f"@{v.username} used {kind} award on [{c.shortlink}]({c.shortlink})")
|
||||||
elif kind == "bird":
|
elif kind == "bird":
|
||||||
if author.longpost:
|
if author.longpost:
|
||||||
return {"error": "This user is the under the effect of a conflicting award: Pizzashill award."}, 404
|
return {"error": "This user is the under the effect of a conflicting award: Pizzashill award."}, 404
|
||||||
|
@ -464,32 +464,32 @@ def award_comment(cid, v):
|
||||||
else: author.bird = time.time() + 86400
|
else: author.bird = time.time() + 86400
|
||||||
elif kind == "eye":
|
elif kind == "eye":
|
||||||
author.eye = True
|
author.eye = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(83):
|
if not author.has_badge(83):
|
||||||
new_badge = Badge(badge_id=83, user_id=author.id)
|
new_badge = Badge(badge_id=83, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "alt":
|
elif kind == "alt":
|
||||||
author.alt = True
|
author.alt = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(84):
|
if not author.has_badge(84):
|
||||||
new_badge = Badge(badge_id=84, user_id=author.id)
|
new_badge = Badge(badge_id=84, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "unblockable":
|
elif kind == "unblockable":
|
||||||
author.unblockable = True
|
author.unblockable = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(87):
|
if not author.has_badge(87):
|
||||||
new_badge = Badge(badge_id=87, user_id=author.id)
|
new_badge = Badge(badge_id=87, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
|
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
|
||||||
elif kind == "fish":
|
elif kind == "fish":
|
||||||
author.fish = True
|
author.fish = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(90):
|
if not author.has_badge(90):
|
||||||
new_badge = Badge(badge_id=90, user_id=author.id)
|
new_badge = Badge(badge_id=90, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
elif kind == "grinch":
|
elif kind == "grinch":
|
||||||
author.grinch = True
|
author.grinch = True
|
||||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||||
if not author.has_badge(91):
|
if not author.has_badge(91):
|
||||||
new_badge = Badge(badge_id=91, user_id=author.id)
|
new_badge = Badge(badge_id=91, user_id=author.id)
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
|
@ -555,7 +555,7 @@ def admin_userawards_post(v):
|
||||||
|
|
||||||
for key, value in notify_awards.items(): text += f" - **{value}** {AWARDS[key]['title']} {'Awards' if value != 1 else 'Award'}\n"
|
for key, value in notify_awards.items(): text += f" - **{value}** {AWARDS[key]['title']} {'Awards' if value != 1 else 'Award'}\n"
|
||||||
|
|
||||||
send_notification(u.id, text)
|
send_repeatable_notification(u.id, text)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,7 @@ def api_comment(v):
|
||||||
|
|
||||||
if len(similar_comments) > threshold:
|
if len(similar_comments) > threshold:
|
||||||
text = "Your account has been suspended for 1 day for the following reason:\n\n> Too much spam!"
|
text = "Your account has been suspended for 1 day for the following reason:\n\n> Too much spam!"
|
||||||
send_notification(v.id, text)
|
send_repeatable_notification(v.id, text)
|
||||||
|
|
||||||
v.ban(reason="Spamming.",
|
v.ban(reason="Spamming.",
|
||||||
days=1)
|
days=1)
|
||||||
|
@ -719,7 +719,7 @@ def edit_comment(cid, v):
|
||||||
|
|
||||||
if len(similar_comments) > threshold:
|
if len(similar_comments) > threshold:
|
||||||
text = "Your account has been suspended for 1 day for the following reason:\n\n> Too much spam!"
|
text = "Your account has been suspended for 1 day for the following reason:\n\n> Too much spam!"
|
||||||
send_notification(v.id, text)
|
send_repeatable_notification(v.id, text)
|
||||||
|
|
||||||
v.ban(reason="Spamming.",
|
v.ban(reason="Spamming.",
|
||||||
days=1)
|
days=1)
|
||||||
|
@ -931,13 +931,13 @@ def toggle_pin_comment(cid, v):
|
||||||
if comment.is_pinned:
|
if comment.is_pinned:
|
||||||
if v.id != comment.author_id:
|
if v.id != comment.author_id:
|
||||||
message = f"@{v.username} has pinned your [comment]({comment.permalink})!"
|
message = f"@{v.username} has pinned your [comment]({comment.permalink})!"
|
||||||
send_notification(comment.author_id, message)
|
send_repeatable_notification(comment.author_id, message)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Comment pinned!"}
|
return {"message": "Comment pinned!"}
|
||||||
else:
|
else:
|
||||||
if v.id != comment.author_id:
|
if v.id != comment.author_id:
|
||||||
message = f"@{v.username} has unpinned your [comment]({comment.permalink})!"
|
message = f"@{v.username} has unpinned your [comment]({comment.permalink})!"
|
||||||
send_notification(comment.author_id, message)
|
send_repeatable_notification(comment.author_id, message)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Comment unpinned!"}
|
return {"message": "Comment unpinned!"}
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ def front_all(v):
|
||||||
if v.agendaposter_expires_utc and v.agendaposter_expires_utc < time.time():
|
if v.agendaposter_expires_utc and v.agendaposter_expires_utc < time.time():
|
||||||
v.agendaposter_expires_utc = 0
|
v.agendaposter_expires_utc = 0
|
||||||
v.agendaposter = None
|
v.agendaposter = None
|
||||||
send_notification(v.id, "Your agendaposter theme has expired!")
|
send_repeatable_notification(v.id, "Your agendaposter theme has expired!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
badge = v.has_badge(26)
|
badge = v.has_badge(26)
|
||||||
if badge: g.db.delete(badge)
|
if badge: g.db.delete(badge)
|
||||||
|
@ -169,25 +169,25 @@ def front_all(v):
|
||||||
|
|
||||||
if v.flairchanged and v.flairchanged < time.time():
|
if v.flairchanged and v.flairchanged < time.time():
|
||||||
v.flairchanged = None
|
v.flairchanged = None
|
||||||
send_notification(v.id, "Your flair lock has expired. You can now change your flair!")
|
send_repeatable_notification(v.id, "Your flair lock has expired. You can now change your flair!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
if v.marseyawarded and v.marseyawarded < time.time():
|
if v.marseyawarded and v.marseyawarded < time.time():
|
||||||
v.marseyawarded = None
|
v.marseyawarded = None
|
||||||
send_notification(v.id, "Your marsey award has expired!")
|
send_repeatable_notification(v.id, "Your marsey award has expired!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
if v.longpost and v.longpost < time.time():
|
if v.longpost and v.longpost < time.time():
|
||||||
v.longpost = None
|
v.longpost = None
|
||||||
send_notification(v.id, "Your pizzashill award has expired!")
|
send_repeatable_notification(v.id, "Your pizzashill award has expired!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
if v.bird and v.bird < time.time():
|
if v.bird and v.bird < time.time():
|
||||||
v.bird = None
|
v.bird = None
|
||||||
send_notification(v.id, "Your bird site award has expired!")
|
send_repeatable_notification(v.id, "Your bird site award has expired!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
|
|
@ -313,22 +313,6 @@ def sign_up_post(v):
|
||||||
|
|
||||||
ref_id = int(request.values.get("referred_by", 0))
|
ref_id = int(request.values.get("referred_by", 0))
|
||||||
|
|
||||||
# if ref_id:
|
|
||||||
# ref_user = g.db.query(User).filter_by(id=ref_id).first()
|
|
||||||
|
|
||||||
# if ref_user:
|
|
||||||
# badge_types = g.db.query(BadgeDef).filter(BadgeDef.qualification_expr.isnot(None)).all()
|
|
||||||
# for badge in badge_types:
|
|
||||||
# if eval(badge.qualification_expr, {}, {'v': ref_user}):
|
|
||||||
# if not ref_user.has_badge(badge.id):
|
|
||||||
# new_badge = Badge(user_id=ref_user.id, badge_id=badge.id)
|
|
||||||
# g.db.add(new_badge)
|
|
||||||
# else:
|
|
||||||
# bad_badge = ref_user.has_badge(badge.id)
|
|
||||||
# if bad_badge: g.db.delete(bad_badge)
|
|
||||||
|
|
||||||
# g.db.add(ref_user)
|
|
||||||
|
|
||||||
id_1 = g.db.query(User.id).filter_by(id=7).count()
|
id_1 = g.db.query(User.id).filter_by(id=7).count()
|
||||||
users_count = g.db.query(User.id).count()
|
users_count = g.db.query(User.id).count()
|
||||||
if id_1 == 0 and users_count < 7: admin_level=3
|
if id_1 == 0 and users_count < 7: admin_level=3
|
||||||
|
|
|
@ -123,7 +123,7 @@ def admin_app_approve(v, aid):
|
||||||
|
|
||||||
g.db.add(new_auth)
|
g.db.add(new_auth)
|
||||||
|
|
||||||
send_notification(user.id, f"Your application `{app.app_name}` has been approved. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.")
|
send_repeatable_notification(user.id, f"Your application `{app.app_name}` has been approved. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.")
|
||||||
|
|
||||||
ma = ModAction(
|
ma = ModAction(
|
||||||
kind="approve_app",
|
kind="approve_app",
|
||||||
|
@ -147,7 +147,7 @@ def admin_app_revoke(v, aid):
|
||||||
if app.id:
|
if app.id:
|
||||||
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth)
|
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth)
|
||||||
|
|
||||||
send_notification(app.author.id, f"Your application `{app.app_name}` has been revoked.")
|
send_repeatable_notification(app.author.id, f"Your application `{app.app_name}` has been revoked.")
|
||||||
|
|
||||||
g.db.delete(app)
|
g.db.delete(app)
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ def admin_app_reject(v, aid):
|
||||||
|
|
||||||
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth)
|
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth)
|
||||||
|
|
||||||
send_notification(app.author.id, f"Your application `{app.app_name}` has been rejected.")
|
send_repeatable_notification(app.author.id, f"Your application `{app.app_name}` has been rejected.")
|
||||||
|
|
||||||
g.db.delete(app)
|
g.db.delete(app)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from files.helpers.sanitize import *
|
||||||
from files.helpers.filters import *
|
from files.helpers.filters import *
|
||||||
from files.helpers.markdown import *
|
from files.helpers.markdown import *
|
||||||
from files.helpers.session import *
|
from files.helpers.session import *
|
||||||
from files.helpers.alerts import send_notification, NOTIFY_USERS
|
from files.helpers.alerts import *
|
||||||
from files.helpers.discord import send_message
|
from files.helpers.discord import send_message
|
||||||
from files.helpers.const import *
|
from files.helpers.const import *
|
||||||
from files.classes import *
|
from files.classes import *
|
||||||
|
@ -64,12 +64,17 @@ def publish(pid, v):
|
||||||
user = g.db.query(User).filter_by(username=username).first()
|
user = g.db.query(User).filter_by(username=username).first()
|
||||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||||
|
|
||||||
for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: [{post.title}]({post.permalink})")
|
cid = notif_comment(f"@{v.username} has mentioned you: [{post.title}]({post.permalink})")
|
||||||
|
for x in notify_users:
|
||||||
|
add_notif(cid, x)
|
||||||
|
|
||||||
|
|
||||||
|
cid = notif_comment(f"@{v.username} has made a new post: [{post.title}]({post.permalink})", True)
|
||||||
for follow in v.followers:
|
for follow in v.followers:
|
||||||
user = get_account(follow.user_id)
|
user = get_account(follow.user_id)
|
||||||
if post.club and not user.club_allowed: continue
|
if post.club and not user.paid_dues: continue
|
||||||
send_notification(user.id, f"@{v.username} has made a new post: [{post.title}]({post.permalink})", True)
|
add_notif(cid, user.id)
|
||||||
|
|
||||||
|
|
||||||
cache.delete_memoized(frontlist)
|
cache.delete_memoized(frontlist)
|
||||||
|
|
||||||
|
@ -554,9 +559,10 @@ def edit_post(pid, v):
|
||||||
user = g.db.query(User).filter_by(username=username).first()
|
user = g.db.query(User).filter_by(username=username).first()
|
||||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||||
|
|
||||||
message = f"@{v.username} has mentioned you: [{p.title}]({p.permalink})"
|
cid = notif_comment(f"@{v.username} has mentioned you: [{p.title}]({p.permalink})")
|
||||||
|
for x in notify_users:
|
||||||
|
add_notif(cid, x)
|
||||||
|
|
||||||
for x in notify_users: send_notification(x, message)
|
|
||||||
|
|
||||||
|
|
||||||
if (title != p.title or body != p.body) and v.id == p.author_id:
|
if (title != p.title or body != p.body) and v.id == p.author_id:
|
||||||
|
@ -881,7 +887,7 @@ def submit_post(v):
|
||||||
if max(len(similar_urls), len(similar_posts)) >= threshold:
|
if max(len(similar_urls), len(similar_posts)) >= threshold:
|
||||||
|
|
||||||
text = "Your account has been suspended for 1 day for the following reason:\n\n> Too much spam!"
|
text = "Your account has been suspended for 1 day for the following reason:\n\n> Too much spam!"
|
||||||
send_notification(v.id, text)
|
send_repeatable_notification(v.id, text)
|
||||||
|
|
||||||
v.ban(reason="Spamming.",
|
v.ban(reason="Spamming.",
|
||||||
days=1)
|
days=1)
|
||||||
|
@ -1068,12 +1074,15 @@ def submit_post(v):
|
||||||
user = g.db.query(User).filter_by(username=username).first()
|
user = g.db.query(User).filter_by(username=username).first()
|
||||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||||
|
|
||||||
for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: [{title}]({new_post.permalink})")
|
cid = notif_comment(f"@{v.username} has mentioned you: [{title}]({new_post.permalink})")
|
||||||
|
for x in notify_users:
|
||||||
|
add_notif(cid, x)
|
||||||
|
|
||||||
|
cid = notif_comment(f"@{v.username} has made a new post: [{title}]({new_post.permalink})", True)
|
||||||
for follow in v.followers:
|
for follow in v.followers:
|
||||||
user = get_account(follow.user_id)
|
user = get_account(follow.user_id)
|
||||||
if new_post.club and not user.club_allowed: continue
|
if new_post.club and not user.paid_dues: continue
|
||||||
send_notification(user.id, f"@{v.username} has made a new post: [{title}]({new_post.permalink})", True)
|
add_notif(cid, user.id)
|
||||||
|
|
||||||
g.db.add(new_post)
|
g.db.add(new_post)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
|
@ -252,9 +252,11 @@ def settings_profile_post(v):
|
||||||
username = mention["href"].split("@")[1]
|
username = mention["href"].split("@")[1]
|
||||||
user = g.db.query(User).filter_by(username=username).first()
|
user = g.db.query(User).filter_by(username=username).first()
|
||||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||||
|
|
||||||
|
cid = notif_comment(f"@{v.username} has added you to their friends list!")
|
||||||
|
|
||||||
for x in notify_users:
|
for x in notify_users:
|
||||||
message = f"@{v.username} has added you to their friends list!"
|
add_notif(cid, x)
|
||||||
send_notification(x, message)
|
|
||||||
|
|
||||||
v.friends = friends[:500]
|
v.friends = friends[:500]
|
||||||
v.friends_html=friends_html
|
v.friends_html=friends_html
|
||||||
|
@ -298,9 +300,10 @@ def settings_profile_post(v):
|
||||||
user = g.db.query(User).filter_by(username=username).first()
|
user = g.db.query(User).filter_by(username=username).first()
|
||||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||||
|
|
||||||
|
cid = notif_comment(f"@{v.username} has added you to their enemies list!")
|
||||||
|
|
||||||
for x in notify_users:
|
for x in notify_users:
|
||||||
message = f"@{v.username} has added you to their enemies list!"
|
add_notif(cid, x)
|
||||||
send_notification(x, message)
|
|
||||||
|
|
||||||
v.enemies = enemies[:500]
|
v.enemies = enemies[:500]
|
||||||
v.enemies_html=enemies_html
|
v.enemies_html=enemies_html
|
||||||
|
@ -365,9 +368,12 @@ def settings_profile_post(v):
|
||||||
username = mention["href"].split("@")[1]
|
username = mention["href"].split("@")[1]
|
||||||
user = g.db.query(User).filter_by(username=username).first()
|
user = g.db.query(User).filter_by(username=username).first()
|
||||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||||
|
|
||||||
|
cid = notif_comment(f"@{v.username} has added you to their friends list!")
|
||||||
|
|
||||||
for x in notify_users:
|
for x in notify_users:
|
||||||
message = f"@{v.username} has added you to their friends list!"
|
add_notif(cid, x)
|
||||||
send_notification(x, message)
|
|
||||||
|
|
||||||
v.bio = bio[:1500]
|
v.bio = bio[:1500]
|
||||||
v.bio_html=bio_html
|
v.bio_html=bio_html
|
||||||
|
@ -574,7 +580,7 @@ def gumroad(v):
|
||||||
elif v.patron == 5: procoins = 50000
|
elif v.patron == 5: procoins = 50000
|
||||||
|
|
||||||
v.procoins += procoins
|
v.procoins += procoins
|
||||||
send_notification(v.id, f"You were given {procoins} Marseybux! You can use them to buy awards in the [shop](/shop).")
|
send_repeatable_notification(v.id, f"You have received {procoins} Marseybux! You can use them to buy awards in the [shop](/shop).")
|
||||||
|
|
||||||
if v.truecoins > 150 and v.patron > 0: v.cluballowed = True
|
if v.truecoins > 150 and v.patron > 0: v.cluballowed = True
|
||||||
if v.patron > 3 and v.verified == None: v.verified = "Verified"
|
if v.patron > 3 and v.verified == None: v.verified = "Verified"
|
||||||
|
@ -938,10 +944,7 @@ def settings_block_user(v):
|
||||||
)
|
)
|
||||||
g.db.add(new_block)
|
g.db.add(new_block)
|
||||||
|
|
||||||
|
send_notification(user.id, f"@{v.username} has blocked you!")
|
||||||
|
|
||||||
existing = g.db.query(Notification.id).filter_by(blocksender=v.id, user_id=user.id).first()
|
|
||||||
if not existing: send_block_notif(v.id, user.id, f"@{v.username} has blocked you!")
|
|
||||||
|
|
||||||
cache.delete_memoized(frontlist)
|
cache.delete_memoized(frontlist)
|
||||||
|
|
||||||
|
@ -964,8 +967,7 @@ def settings_unblock_user(v):
|
||||||
|
|
||||||
g.db.delete(x)
|
g.db.delete(x)
|
||||||
|
|
||||||
existing = g.db.query(Notification.id).filter_by(unblocksender=v.id, user_id=user.id).first()
|
send_notification(user.id, f"@{v.username} has unblocked you!")
|
||||||
if not existing: send_unblock_notif(v.id, user.id, f"@{v.username} has unblocked you!")
|
|
||||||
|
|
||||||
cache.delete_memoized(frontlist)
|
cache.delete_memoized(frontlist)
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ def pay_rent(v):
|
||||||
u = get_account(253)
|
u = get_account(253)
|
||||||
u.coins += 500
|
u.coins += 500
|
||||||
g.db.add(u)
|
g.db.add(u)
|
||||||
send_notification(u.id, f"@{v.username} has paid rent!")
|
send_repeatable_notification(u.id, f"@{v.username} has paid rent!")
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Rent paid!"}
|
return {"message": "Rent paid!"}
|
||||||
|
|
||||||
|
@ -135,20 +135,20 @@ def steal(v):
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
u.coins -= 700
|
u.coins -= 700
|
||||||
g.db.add(u)
|
g.db.add(u)
|
||||||
send_notification(u.id, f"Some [grubby little rentoid](/@{v.username}) has absconded with 700 of your hard-earned dramacoins to fuel his Funko Pop addiction. Stop being so trusting.")
|
send_repeatable_notification(u.id, f"Some [grubby little rentoid](/@{v.username}) has absconded with 700 of your hard-earned dramacoins to fuel his Funko Pop addiction. Stop being so trusting.")
|
||||||
send_notification(v.id, f"You have successfully shorted your heroic landlord 700 dramacoins in rent. You're slightly less materially poor, but somehow even moreso morally. Are you proud of yourself?")
|
send_repeatable_notification(v.id, f"You have successfully shorted your heroic landlord 700 dramacoins in rent. You're slightly less materially poor, but somehow even moreso morally. Are you proud of yourself?")
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Attempt successful!"}
|
return {"message": "Attempt successful!"}
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if random.random() < 0.15:
|
if random.random() < 0.15:
|
||||||
send_notification(u.id, f"You caught [this sniveling little renthog](/@{v.username}) trying to rob you. After beating him within an inch of his life, you sold his Nintendo Switch for 500 dramacoins and called the cops. He was sentenced to one (1) day in renthog prison.")
|
send_repeatable_notification(u.id, f"You caught [this sniveling little renthog](/@{v.username}) trying to rob you. After beating him within an inch of his life, you sold his Nintendo Switch for 500 dramacoins and called the cops. He was sentenced to one (1) day in renthog prison.")
|
||||||
send_notification(v.id, f"The ever-vigilant landchad has caught you trying to steal his hard-earned rent money. The police take you away and laugh as you impotently stutter A-ACAB :sob: You are fined 500 dramacoins and sentenced to one (1) day in renthog prison.")
|
send_repeatable_notification(v.id, f"The ever-vigilant landchad has caught you trying to steal his hard-earned rent money. The police take you away and laugh as you impotently stutter A-ACAB :sob: You are fined 500 dramacoins and sentenced to one (1) day in renthog prison.")
|
||||||
v.ban(days=1, reason="Jailed thief")
|
v.ban(days=1, reason="Jailed thief")
|
||||||
v.fail_utc = int(time.time())
|
v.fail_utc = int(time.time())
|
||||||
else:
|
else:
|
||||||
send_notification(u.id, f"You caught [this sniveling little renthog](/@{v.username}) trying to rob you. After beating him within an inch of his life, you showed mercy in exchange for a 500 dramacoin tip. This time.")
|
send_repeatable_notification(u.id, f"You caught [this sniveling little renthog](/@{v.username}) trying to rob you. After beating him within an inch of his life, you showed mercy in exchange for a 500 dramacoin tip. This time.")
|
||||||
send_notification(v.id, f"The ever-vigilant landchad has caught you trying to steal his hard-earned rent money. You were able to convince him to spare your life with a 500 dramacoin tip. This time.")
|
send_repeatable_notification(v.id, f"The ever-vigilant landchad has caught you trying to steal his hard-earned rent money. You were able to convince him to spare your life with a 500 dramacoin tip. This time.")
|
||||||
v.fail2_utc = int(time.time())
|
v.fail2_utc = int(time.time())
|
||||||
v.coins -= 500
|
v.coins -= 500
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
@ -187,7 +187,7 @@ def suicide(v, username):
|
||||||
if v.admin_level == 0 and t - v.suicide_utc < 86400: return {"message": "You're on 1-day cooldown!"}
|
if v.admin_level == 0 and t - v.suicide_utc < 86400: return {"message": "You're on 1-day cooldown!"}
|
||||||
user = get_user(username)
|
user = get_user(username)
|
||||||
suicide = f"Hi there,\n\nA [concerned user]({v.url}) reached out to us about you.\n\nWhen you're in the middle of something painful, it may feel like you don't have a lot of options. But whatever you're going through, you deserve help and there are people who are here for you.\n\nThere are resources available in your area that are free, confidential, and available 24/7:\n\n- Call, Text, or Chat with Canada's [Crisis Services Canada](https://www.crisisservicescanada.ca/en/)\n- Call, Email, or Visit the UK's [Samaritans](https://www.samaritans.org/)\n- Text CHAT to America's [Crisis Text Line](https://www.crisistextline.org/) at 741741.\nIf you don't see a resource in your area above, the moderators at r/SuicideWatch keep a comprehensive list of resources and hotlines for people organized by location. Find Someone Now\n\nIf you think you may be depressed or struggling in another way, don't ignore it or brush it aside. Take yourself and your feelings seriously, and reach out to someone.\n\nIt may not feel like it, but you have options. There are people available to listen to you, and ways to move forward.\n\nYour fellow users care about you and there are people who want to help."
|
suicide = f"Hi there,\n\nA [concerned user]({v.url}) reached out to us about you.\n\nWhen you're in the middle of something painful, it may feel like you don't have a lot of options. But whatever you're going through, you deserve help and there are people who are here for you.\n\nThere are resources available in your area that are free, confidential, and available 24/7:\n\n- Call, Text, or Chat with Canada's [Crisis Services Canada](https://www.crisisservicescanada.ca/en/)\n- Call, Email, or Visit the UK's [Samaritans](https://www.samaritans.org/)\n- Text CHAT to America's [Crisis Text Line](https://www.crisistextline.org/) at 741741.\nIf you don't see a resource in your area above, the moderators at r/SuicideWatch keep a comprehensive list of resources and hotlines for people organized by location. Find Someone Now\n\nIf you think you may be depressed or struggling in another way, don't ignore it or brush it aside. Take yourself and your feelings seriously, and reach out to someone.\n\nIt may not feel like it, but you have options. There are people available to listen to you, and ways to move forward.\n\nYour fellow users care about you and there are people who want to help."
|
||||||
send_notification(user.id, suicide)
|
send_repeatable_notification(user.id, suicide)
|
||||||
v.suicide_utc = t
|
v.suicide_utc = t
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
@ -224,26 +224,26 @@ def transfer_coins(v, username):
|
||||||
if 'rdrama.net' in request.host: tax_receiver.coins += tax/3
|
if 'rdrama.net' in request.host: tax_receiver.coins += tax/3
|
||||||
else: tax_receiver.coins += tax
|
else: tax_receiver.coins += tax
|
||||||
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
||||||
send_notification(TAX_RECEIVER_ID, log_message)
|
send_repeatable_notification(TAX_RECEIVER_ID, log_message)
|
||||||
g.db.add(tax_receiver)
|
g.db.add(tax_receiver)
|
||||||
|
|
||||||
if 'rdrama.net' in request.host:
|
if 'rdrama.net' in request.host:
|
||||||
carp = g.db.query(User).filter_by(id=CARP_ID).first()
|
carp = g.db.query(User).filter_by(id=CARP_ID).first()
|
||||||
carp.coins += tax/3
|
carp.coins += tax/3
|
||||||
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
||||||
send_notification(CARP_ID, log_message)
|
send_repeatable_notification(CARP_ID, log_message)
|
||||||
g.db.add(carp)
|
g.db.add(carp)
|
||||||
|
|
||||||
dad = g.db.query(User).filter_by(id=DAD_ID).first()
|
dad = g.db.query(User).filter_by(id=DAD_ID).first()
|
||||||
dad.coins += tax/3
|
dad.coins += tax/3
|
||||||
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
log_message = f"[@{v.username}]({v.url}) has transferred {amount} {app.config['COINS_NAME']} to [@{receiver.username}]({receiver.url})"
|
||||||
send_notification(DAD_ID, log_message)
|
send_repeatable_notification(DAD_ID, log_message)
|
||||||
g.db.add(dad)
|
g.db.add(dad)
|
||||||
else: tax = 0
|
else: tax = 0
|
||||||
|
|
||||||
receiver.coins += amount-tax
|
receiver.coins += amount-tax
|
||||||
v.coins -= amount
|
v.coins -= amount
|
||||||
send_notification(receiver.id, f"🤑 [@{v.username}]({v.url}) has gifted you {amount-tax} {app.config['COINS_NAME']}!")
|
send_repeatable_notification(receiver.id, f"🤑 [@{v.username}]({v.url}) has gifted you {amount-tax} {app.config['COINS_NAME']}!")
|
||||||
g.db.add(receiver)
|
g.db.add(receiver)
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
||||||
|
@ -803,8 +803,7 @@ def follow_user(username, v):
|
||||||
target.stored_subscriber_count = g.db.query(Follow.id).filter_by(target_id=target.id).count()
|
target.stored_subscriber_count = g.db.query(Follow.id).filter_by(target_id=target.id).count()
|
||||||
g.db.add(target)
|
g.db.add(target)
|
||||||
|
|
||||||
existing = g.db.query(Notification.id).filter_by(followsender=v.id, user_id=target.id).first()
|
send_notification(target.id, f"@{v.username} has followed you!")
|
||||||
if not existing: send_follow_notif(v.id, target.id, f"@{v.username} has followed you!")
|
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
@ -822,16 +821,14 @@ def unfollow_user(username, v):
|
||||||
|
|
||||||
follow = g.db.query(Follow).filter_by(user_id=v.id, target_id=target.id).first()
|
follow = g.db.query(Follow).filter_by(user_id=v.id, target_id=target.id).first()
|
||||||
|
|
||||||
if not follow: return {"message": "User unfollowed!"}
|
if follow:
|
||||||
|
|
||||||
g.db.delete(follow)
|
g.db.delete(follow)
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
target.stored_subscriber_count = g.db.query(Follow.id).filter_by(target_id=target.id).count()
|
target.stored_subscriber_count = g.db.query(Follow.id).filter_by(target_id=target.id).count()
|
||||||
g.db.add(target)
|
g.db.add(target)
|
||||||
|
|
||||||
existing = g.db.query(Notification.id).filter_by(unfollowsender=v.id, user_id=target.id).first()
|
send_notification(target.id, f"@{v.username} has unfollowed you!")
|
||||||
if not existing: send_unfollow_notif(v.id, target.id, f"@{v.username} has unfollowed you!")
|
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
@ -854,8 +851,7 @@ def remove_follow(username, v):
|
||||||
v.stored_subscriber_count = g.db.query(Follow.id).filter_by(target_id=v.id).count()
|
v.stored_subscriber_count = g.db.query(Follow.id).filter_by(target_id=v.id).count()
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
||||||
existing = g.db.query(Notification.id).filter_by(removefollowsender=v.id, user_id=target.id).first()
|
send_repeatable_notification(target.id, f"@{v.username} has removed your follow!")
|
||||||
if not existing: send_unfollow_notif(v.id, target.id, f"@{v.username} has removed your follow!")
|
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
from files.helpers.wrappers import *
|
from files.helpers.wrappers import *
|
||||||
from files.helpers.get import *
|
from files.helpers.get import *
|
||||||
from files.helpers.const import AUTOBETTER_ID
|
from files.helpers.const import AUTOBETTER_ID
|
||||||
from files.helpers.alerts import send_notification
|
|
||||||
from files.classes import *
|
from files.classes import *
|
||||||
from flask import *
|
from flask import *
|
||||||
from files.__main__ import app, limiter, cache
|
from files.__main__ import app, limiter, cache
|
||||||
|
|
|
@ -210,7 +210,10 @@
|
||||||
|
|
||||||
{% if c.parent_comment_id and not standalone and level != 1 %}<a href="#comment-{{ c.parent_comment_id }}-only" class="text-muted ml-2"><i class="fas fa-reply fa-sm fa-fw fa-flip-horizontal mr-1"></i>{{ c.parent_comment.author.username }}</a>{% endif %}
|
{% if c.parent_comment_id and not standalone and level != 1 %}<a href="#comment-{{ c.parent_comment_id }}-only" class="text-muted ml-2"><i class="fas fa-reply fa-sm fa-fw fa-flip-horizontal mr-1"></i>{{ c.parent_comment.author.username }}</a>{% endif %}
|
||||||
|
|
||||||
|
{% if c.created_utc %}
|
||||||
<span id="timestamp-{{c.id}}" onmouseover="timestamp('timestamp-{{c.id}}','{{c.created_utc}}')" data-bs-toggle="tooltip" data-bs-placement="bottom" class="time-stamp"> {{c.age_string}}</span>
|
<span id="timestamp-{{c.id}}" onmouseover="timestamp('timestamp-{{c.id}}','{{c.created_utc}}')" data-bs-toggle="tooltip" data-bs-placement="bottom" class="time-stamp"> {{c.age_string}}</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if c.edited_utc %}
|
{% if c.edited_utc %}
|
||||||
<span class="time-edited" id="time-edit-{{c.id}}" onmouseover="timestamp('time-edit-{{c.id}}','{{c.edited_utc}}')"><span>·</span> <span class="font-italic">Edited {{c.edited_string}}</span></span>
|
<span class="time-edited" id="time-edit-{{c.id}}" onmouseover="timestamp('time-edit-{{c.id}}','{{c.edited_utc}}')"><span>·</span> <span class="font-italic">Edited {{c.edited_string}}</span></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<label class="custom-control-label" for="oldsite"></label>
|
<label class="custom-control-label" for="oldsite"></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="text-small-extra text-muted">Enable if you would like to display images and videos in full size on the frontpage.</span>
|
<span class="text-small-extra text-muted">Enable if you would like to use the old version of the site.</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,6 @@ CREATE TABLE public.comments (
|
||||||
body character varying(10000),
|
body character varying(10000),
|
||||||
body_html character varying(40000),
|
body_html character varying(40000),
|
||||||
ban_reason character varying(25),
|
ban_reason character varying(25),
|
||||||
notifiedto integer,
|
|
||||||
realupvotes integer,
|
realupvotes integer,
|
||||||
top_comment_id integer
|
top_comment_id integer
|
||||||
);
|
);
|
||||||
|
@ -453,11 +452,6 @@ CREATE TABLE public.notifications (
|
||||||
user_id integer,
|
user_id integer,
|
||||||
comment_id integer,
|
comment_id integer,
|
||||||
read boolean NOT NULL,
|
read boolean NOT NULL,
|
||||||
followsender integer,
|
|
||||||
unfollowsender integer,
|
|
||||||
blocksender integer,
|
|
||||||
unblocksender integer,
|
|
||||||
removefollowsender integer
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue