forked from rDrama/rDrama
fsd
parent
038b362858
commit
c9890feb4a
|
@ -524,4 +524,4 @@ NOTIFIED_USERS = {
|
||||||
'kippy': KIPPY_ID,
|
'kippy': KIPPY_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
FORTUNE_REPLIES = ('<b style="color:#6023f8">Your fortune: Allah Wills It</b>','<b style="color:#d302a7">Your fortune: Inshallah, Only Good Things Shall Come To Pass</b>','<b style="color:#e7890c">Your fortune: Allah Smiles At You This Day</b>','<b style="color:#7fec11">Your fortune: Your Bussy Is In For A Blasting</b>','<b style="color:#43fd3b">Your fortune: You Will Be Propositioned By A High-Tier Twink</b>','<b style="color:#9d05da">Your fortune: Repent, You Have Displeased Allah And His Vengeance Is Nigh</b>','<b style="color:#f51c6a">Your fortune: Reply Hazy, Try Again</b>','<b style="color:#00cbb0">Your fortune: lmao you just lost 100 dramacoin</b>','<b style="color:#2a56fb">Your fortune: Yikes 😬</b>','<b style="color:#0893e1">Your fortune: You Will Be Blessed With Many Black Bulls</b>','<b style="color:#16f174">Your fortune: NEETmax, The Day Is Lost If You Venture Outside</b>','<b style="color:#fd4d32">Your fortune: A Taste Of Jannah Awaits You Today</b>','<b style="color:#bac200">Your fortune: Watch Your Back</b>')
|
FORTUNE_REPLIES = ('<b style="color:#6023f8">Your fortune: Allah Wills It</b>','<b style="color:#d302a7">Your fortune: Inshallah, Only Good Things Shall Come To Pass</b>','<b style="color:#e7890c">Your fortune: Allah Smiles At You This Day</b>','<b style="color:#7fec11">Your fortune: Your Bussy Is In For A Blasting</b>','<b style="color:#43fd3b">Your fortune: You Will Be Propositioned By A High-Tier Twink</b>','<b style="color:#9d05da">Your fortune: Repent, You Have Displeased Allah And His Vengeance Is Nigh</b>','<b style="color:#f51c6a">Your fortune: Reply Hazy, Try Again</b>','<b style="color:#00cbb0">Your fortune: lmao you just lost 100 dramacoin</b>','<b style="color:#2a56fb">Your fortune: Yikes 😬</b>','<b style="color:#0893e1">Your fortune: You Will Be Blessed With Many Black Bulls</b>','<b style="color:#16f174">Your fortune: NEETmax, The Day Is Lost If You Venture Outside</b>','<b style="color:#fd4d32">Your fortune: A Taste Of Jannah Awaits You Today</b>','<b style="color:#bac200">Your fortune: Watch Your Back</b>','<b style="color:#6023f8">Your fortune: Outlook good</b>','<b style="color:#d302a7">Your fortune: Godly Luck</b>','<b style="color:#e7890c">Your fortune: Good Luck</b>','<b style="color:#7fec11">Your fortune: Bad Luck</b>','<b style="color:#43fd3b">Your fortune: Good news will come to you by mail</b>','<b style="color:#9d05da">Your fortune: Very Bad Luck</b>','<b style="color:#f51c6a">Your fortune: Reply hazy, try again</b>','<b style="color:#00cbb0">Your fortune: キタ━━━━━━(゚∀゚)━━━━━━ !!!!</b>','<b style="color:#2a56fb">Your fortune: Better not tell you now</b>','<b style="color:#0893e1">Your fortune: You will meet a dark handsome stranger</b>','<b style="color:#16f174">Your fortune: ( ´_ゝ`)フーン</b>','<b style="color:#fd4d32">Your fortune: Excellent Luck</b>','<b style="color:#bac200">Your fortune: Average Luck</b>')
|
||||||
|
|
|
@ -48,6 +48,8 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
||||||
|
|
||||||
if comment.post and comment.post.club and not (v and (v.paid_dues or v.id in [comment.author_id, comment.post.author_id])): abort(403)
|
if comment.post and comment.post.club and not (v and (v.paid_dues or v.id in [comment.author_id, comment.post.author_id])): abort(403)
|
||||||
|
|
||||||
|
if comment.post and comment.post.private and not (v and (v.admin_level > 1 or v.id == comment.post.author.id)): abort(403)
|
||||||
|
|
||||||
if not comment.parent_submission and not (v and (comment.author.id == v.id or comment.sentto == v.id)) and not (v and v.admin_level > 1) : abort(403)
|
if not comment.parent_submission and not (v and (comment.author.id == v.id or comment.sentto == v.id)) and not (v and v.admin_level > 1) : abort(403)
|
||||||
|
|
||||||
if not pid:
|
if not pid:
|
||||||
|
|
|
@ -534,35 +534,36 @@ def messagereply(v):
|
||||||
g.db.add(new_comment)
|
g.db.add(new_comment)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
if PUSHER_ID and user_id != v.id:
|
if user_id != v.id:
|
||||||
notif = Notification(comment_id=new_comment.id, user_id=user_id)
|
notif = Notification(comment_id=new_comment.id, user_id=user_id)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
if len(message) > 500: notifbody = message[:500] + '...'
|
if PUSHER_ID:
|
||||||
else: notifbody = message
|
if len(message) > 500: notifbody = message[:500] + '...'
|
||||||
|
else: notifbody = message
|
||||||
|
|
||||||
beams_client.publish_to_interests(
|
beams_client.publish_to_interests(
|
||||||
interests=[f'{request.host}{user_id}'],
|
interests=[f'{request.host}{user_id}'],
|
||||||
publish_body={
|
publish_body={
|
||||||
'web': {
|
'web': {
|
||||||
'notification': {
|
'notification': {
|
||||||
'title': f'New message from @{v.username}',
|
'title': f'New message from @{v.username}',
|
||||||
'body': notifbody,
|
'body': notifbody,
|
||||||
'deep_link': f'{SITE_FULL}/notifications?messages=true',
|
'deep_link': f'{SITE_FULL}/notifications?messages=true',
|
||||||
'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp',
|
'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'fcm': {
|
||||||
|
'notification': {
|
||||||
|
'title': f'New message from @{v.username}',
|
||||||
|
'body': notifbody,
|
||||||
|
},
|
||||||
|
'data': {
|
||||||
|
'url': '/notifications?messages=true',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'fcm': {
|
)
|
||||||
'notification': {
|
|
||||||
'title': f'New message from @{v.username}',
|
|
||||||
'body': notifbody,
|
|
||||||
},
|
|
||||||
'data': {
|
|
||||||
'url': '/notifications?messages=true',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if new_comment.top_comment.sentto == 0:
|
if new_comment.top_comment.sentto == 0:
|
||||||
|
|
Loading…
Reference in New Issue