diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2022-10-10 15:18:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-10 15:18:31 +0200 |
commit | c43ed8e8624383db5a0cf22b210cee202bae323c (patch) | |
tree | d2d2c3d06a0b15048bf1e1893b2bc8d07ed2214d /server/tests/fixtures/peertube-plugin-test-four/main.js | |
parent | 213bb3bb58b719679d533811b2e2c3852a3dd067 (diff) | |
download | PeerTube-c43ed8e8624383db5a0cf22b210cee202bae323c.tar.gz PeerTube-c43ed8e8624383db5a0cf22b210cee202bae323c.tar.zst PeerTube-c43ed8e8624383db5a0cf22b210cee202bae323c.zip |
Expose PeerTube socket to plugins (#5239)
* server(pluginHelpers): add socket
* test(plugins): add socket cases
* fixes after review
* Update plugin-helpers.ts
* Update plugin-helpers.ts
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-four/main.js')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test-four/main.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js index 5194e3e02..3e848c49e 100644 --- a/server/tests/fixtures/peertube-plugin-test-four/main.js +++ b/server/tests/fixtures/peertube-plugin-test-four/main.js | |||
@@ -128,6 +128,22 @@ async function register ({ | |||
128 | 128 | ||
129 | return res.json(result) | 129 | return res.json(result) |
130 | }) | 130 | }) |
131 | |||
132 | router.post('/send-notification', async (req, res) => { | ||
133 | peertubeHelpers.socket.sendNotification(req.body.userId, { | ||
134 | type: 1, | ||
135 | userId: req.body.userId | ||
136 | }) | ||
137 | |||
138 | return res.sendStatus(201) | ||
139 | }) | ||
140 | |||
141 | router.post('/send-video-live-new-state/:uuid', async (req, res) => { | ||
142 | const video = await peertubeHelpers.videos.loadByIdOrUUID(req.params.uuid) | ||
143 | peertubeHelpers.socket.sendVideoLiveNewState(video) | ||
144 | |||
145 | return res.sendStatus(201) | ||
146 | }) | ||
131 | } | 147 | } |
132 | 148 | ||
133 | } | 149 | } |