remotes/1693045480750635534/spooky-22
Aevann1 2021-09-27 23:50:35 +02:00
parent 33a7ebf0dc
commit 97be0072c0
4 changed files with 8 additions and 4 deletions

View File

@ -34,6 +34,7 @@ class Comment(Base):
is_bot = Column(Boolean, default=False)
is_pinned = Column(String(255))
sentto=Column(Integer)
notifiedto=Column(Integer)
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
oauth_app = relationship("OauthApp", viewonly=True)
upvotes = Column(Integer, default=1)

View File

@ -25,6 +25,7 @@ def send_notification(vid, user, text):
distinguish_level=6,
body=text,
body_html=text_html,
notifiedto=uid
)
g.db.add(new_comment)

View File

@ -354,7 +354,7 @@ def edit_post(pid, v):
message = f"@{v.username} has mentioned you: https://{site}{p.permalink}"
for x in notify_users:
existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == NOTIFICATIONS_ACCOUNT, Comment.sentto == x.id, Comment.body == message).first()
existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == NOTIFICATIONS_ACCOUNT, Comment.sentto == x.id, Comment.body == message, Comment.notifiedto == x.id).first()
if not existing: send_notification(NOTIFICATIONS_ACCOUNT, x, message)

View File

@ -1,4 +1,4 @@
<style>
<!-- <style>
.anchor::before {
display: block;
content: " ";
@ -20,7 +20,7 @@
background-color: initial;
}
}
</style>
</style> -->
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
@ -202,7 +202,9 @@
<a {% if v %}href="{{c.author.url}}"{% else %}href="/logged_out{{c.author.url}}"{% endif %} style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;"><img loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-25 mr-2"/><span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level and 'rdrama' in request.host %}class="mod"{% endif %}>{{c.author.username}}</span></a>
{% if c.author.customtitle %}&nbsp;<bdi style="color: #{{c.author.titlecolor}}">&nbsp;{% if c.author.quadrant %}<img loading="lazy" height="20" src="/assets/images/PCM/quadrants/{{c.author.quadrant}}.webp">{% endif %}{{c.author.customtitle | safe}}</bdi>{% endif %}
{% if c.parent_comment_id and not standalone and level<=7 %}<a href="#comment-{{ c.parent_comment_id }}" 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<=7 %}<a href="#comment-{{ c.parent_comment_id }}" 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 %} -->
<span id="timestamp-{{c.id}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" class="time-stamp">&nbsp;{{c.age_string}}</span>
{% if c.edited_utc %}