pull/138/head
parent
3cb3d0b652
commit
355af22171
|
@ -122,7 +122,7 @@ def add_notif(cid, uid, text, pushnotif_url=''):
|
|||
push_notif({uid}, 'New notification', text, pushnotif_url)
|
||||
|
||||
|
||||
def NOTIFY_USERS(text, v, oldtext=None):
|
||||
def NOTIFY_USERS(text, v, oldtext=None, ghost=False):
|
||||
# Restrict young accounts from generating notifications
|
||||
if v.age < NOTIFICATION_SPAM_AGE_THRESHOLD:
|
||||
return set()
|
||||
|
@ -167,7 +167,7 @@ def NOTIFY_USERS(text, v, oldtext=None):
|
|||
|
||||
notify_users.update(members)
|
||||
|
||||
if v.id not in members:
|
||||
if ghost or v.id not in members:
|
||||
if group.name == 'biofoids': mul = 10
|
||||
else: mul = 5
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ def comment(v:User):
|
|||
execute_zozbot(c, level, post_target, v)
|
||||
|
||||
if not v.shadowbanned:
|
||||
notify_users = NOTIFY_USERS(body, v)
|
||||
notify_users = NOTIFY_USERS(body, v, ghost=c.ghost)
|
||||
|
||||
if notify_users == 'everyone':
|
||||
alert_everyone(c.id)
|
||||
|
@ -652,7 +652,7 @@ def edit_comment(cid, v):
|
|||
if v.marseyawarded and marseyaward_body_regex.search(body_html):
|
||||
abort(403, "You can only type marseys!")
|
||||
|
||||
notify_users = NOTIFY_USERS(body, v, c.body)
|
||||
notify_users = NOTIFY_USERS(body, v, c.body, ghost=c.ghost)
|
||||
|
||||
if notify_users == 'everyone':
|
||||
alert_everyone(c.id)
|
||||
|
|
|
@ -46,7 +46,7 @@ def publish(pid, v):
|
|||
p.created_utc = int(time.time())
|
||||
g.db.add(p)
|
||||
|
||||
notify_users = NOTIFY_USERS(f'{p.title} {p.body}', v)
|
||||
notify_users = NOTIFY_USERS(f'{p.title} {p.body}', v, ghost=p.ghost)
|
||||
|
||||
if notify_users:
|
||||
cid, text = notif_comment2(p)
|
||||
|
@ -641,7 +641,7 @@ def submit_post(v:User, sub=None):
|
|||
gevent.spawn(thumbnail_thread, p.id, v.id)
|
||||
|
||||
if not p.private:
|
||||
notify_users = NOTIFY_USERS(f'{title} {body}', v)
|
||||
notify_users = NOTIFY_USERS(f'{title} {body}', v, ghost=p.ghost)
|
||||
|
||||
if notify_users:
|
||||
cid, text = notif_comment2(p)
|
||||
|
@ -988,7 +988,7 @@ def edit_post(pid, v):
|
|||
|
||||
|
||||
if not p.private:
|
||||
notify_users = NOTIFY_USERS(f'{title} {body}', v, f'{p.title} {p.body}')
|
||||
notify_users = NOTIFY_USERS(f'{title} {body}', v, f'{p.title} {p.body}', ghost=p.ghost)
|
||||
if notify_users:
|
||||
cid, text = notif_comment2(p)
|
||||
if notify_users == 'everyone':
|
||||
|
|
Loading…
Reference in New Issue