add push notifs for repeatable notifications
parent
6f981a58b8
commit
760b2e6a4d
|
@ -37,12 +37,18 @@ def send_repeatable_notification(uid, text):
|
||||||
if not existing_notif:
|
if not existing_notif:
|
||||||
notif = Notification(comment_id=c.id, user_id=uid)
|
notif = Notification(comment_id=c.id, user_id=uid)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
g.db.flush()
|
||||||
|
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{c.id}?read=true#context')
|
||||||
return
|
return
|
||||||
|
|
||||||
cid = create_comment(text_html)
|
cid = create_comment(text_html)
|
||||||
notif = Notification(comment_id=cid, user_id=uid)
|
notif = Notification(comment_id=cid, user_id=uid)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
g.db.flush()
|
||||||
|
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{cid}?read=true#context')
|
||||||
|
|
||||||
|
|
||||||
def send_notification(uid, text):
|
def send_notification(uid, text):
|
||||||
|
|
||||||
|
|
|
@ -176,12 +176,18 @@ def send_repeatable_notification_duplicated(uid, text):
|
||||||
if not existing_notif:
|
if not existing_notif:
|
||||||
notif = Notification(comment_id=c.id, user_id=uid)
|
notif = Notification(comment_id=c.id, user_id=uid)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
g.db.flush()
|
||||||
|
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{c.id}?read=true#context')
|
||||||
return
|
return
|
||||||
|
|
||||||
cid = create_comment_duplicated(text_html)
|
cid = create_comment_duplicated(text_html)
|
||||||
notif = Notification(comment_id=cid, user_id=uid)
|
notif = Notification(comment_id=cid, user_id=uid)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
g.db.flush()
|
||||||
|
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{cid}?read=true#context')
|
||||||
|
|
||||||
|
|
||||||
def execute_blackjack(v, target, body, type):
|
def execute_blackjack(v, target, body, type):
|
||||||
if not blackjack or not body: return False
|
if not blackjack or not body: return False
|
||||||
|
|
Loading…
Reference in New Issue