aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r--server/controllers/api/users/me.ts9
-rw-r--r--server/controllers/api/users/my-subscriptions.ts4
2 files changed, 4 insertions, 9 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts
index 218091d91..4753308e8 100644
--- a/server/controllers/api/users/me.ts
+++ b/server/controllers/api/users/me.ts
@@ -213,19 +213,14 @@ async function updateMe (req: express.Request, res: express.Response) {
213 'noInstanceConfigWarningModal', 213 'noInstanceConfigWarningModal',
214 'noAccountSetupWarningModal', 214 'noAccountSetupWarningModal',
215 'noWelcomeModal', 215 'noWelcomeModal',
216 'emailPublic' 216 'emailPublic',
217 'p2pEnabled'
217 ] 218 ]
218 219
219 for (const key of keysToUpdate) { 220 for (const key of keysToUpdate) {
220 if (body[key] !== undefined) user.set(key, body[key]) 221 if (body[key] !== undefined) user.set(key, body[key])
221 } 222 }
222 223
223 if (body.p2pEnabled !== undefined) {
224 user.set('p2pEnabled', body.p2pEnabled)
225 } else if (body.webTorrentEnabled !== undefined) { // FIXME: deprecated in 4.1
226 user.set('p2pEnabled', body.webTorrentEnabled)
227 }
228
229 if (body.email !== undefined) { 224 if (body.email !== undefined) {
230 if (CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) { 225 if (CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) {
231 user.pendingEmail = body.email 226 user.pendingEmail = body.email
diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts
index 6e2aa3711..c4360f59d 100644
--- a/server/controllers/api/users/my-subscriptions.ts
+++ b/server/controllers/api/users/my-subscriptions.ts
@@ -3,7 +3,7 @@ import express from 'express'
3import { handlesToNameAndHost } from '@server/helpers/actors' 3import { handlesToNameAndHost } from '@server/helpers/actors'
4import { pickCommonVideoQuery } from '@server/helpers/query' 4import { pickCommonVideoQuery } from '@server/helpers/query'
5import { sendUndoFollow } from '@server/lib/activitypub/send' 5import { sendUndoFollow } from '@server/lib/activitypub/send'
6import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' 6import { Hooks } from '@server/lib/plugins/hooks'
7import { VideoChannelModel } from '@server/models/video/video-channel' 7import { VideoChannelModel } from '@server/models/video/video-channel'
8import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' 8import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
9import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' 9import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils'
@@ -29,8 +29,8 @@ import {
29 videosSortValidator 29 videosSortValidator
30} from '../../../middlewares/validators' 30} from '../../../middlewares/validators'
31import { ActorFollowModel } from '../../../models/actor/actor-follow' 31import { ActorFollowModel } from '../../../models/actor/actor-follow'
32import { guessAdditionalAttributesFromQuery } from '../../../models/video/formatter'
32import { VideoModel } from '../../../models/video/video' 33import { VideoModel } from '../../../models/video/video'
33import { Hooks } from '@server/lib/plugins/hooks'
34 34
35const mySubscriptionsRouter = express.Router() 35const mySubscriptionsRouter = express.Router()
36 36