summaryrefslogtreecommitdiffstats
path: root/src/invidious/routes/api/v1/authenticated.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/invidious/routes/api/v1/authenticated.cr')
-rw-r--r--src/invidious/routes/api/v1/authenticated.cr10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/invidious/routes/api/v1/authenticated.cr b/src/invidious/routes/api/v1/authenticated.cr
index c27853ca..b559a01a 100644
--- a/src/invidious/routes/api/v1/authenticated.cr
+++ b/src/invidious/routes/api/v1/authenticated.cr
@@ -397,4 +397,14 @@ module Invidious::Routes::API::V1::Authenticated
env.response.status_code = 204
end
+
+ def self.notifications(env)
+ env.response.content_type = "text/event-stream"
+
+ raw_topics = env.params.body["topics"]? || env.params.query["topics"]?
+ topics = raw_topics.try &.split(",").uniq.first(1000)
+ topics ||= [] of String
+
+ create_notification_stream(env, topics, CONNECTION_CHANNEL)
+ end
end