Add ability to disable all user notifications (#3473)

This commit is contained in:
Émilien Devos
2023-01-05 23:08:05 +00:00
committed by GitHub
parent 865704dc7b
commit 98301a2237
11 changed files with 77 additions and 22 deletions

View File

@@ -147,7 +147,7 @@ module Invidious::Routes::Embed
# PG_DB.exec("UPDATE users SET watched = array_append(watched, $1) WHERE email = $2", id, user.as(User).email)
# end
if notifications && notifications.includes? id
if CONFIG.enable_user_notifications && notifications && notifications.includes? id
Invidious::Database::Users.remove_notification(user.as(User), id)
env.get("user").as(User).notifications.delete(id)
notifications.delete(id)