aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/config.ts12
-rw-r--r--server/controllers/api/server/follows.ts3
-rw-r--r--server/controllers/api/users/my-notifications.ts3
3 files changed, 17 insertions, 1 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 21fa85a08..0c52bfa7a 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -300,6 +300,18 @@ function customConfig (): CustomConfig {
300 enabled: CONFIG.FOLLOWERS.INSTANCE.ENABLED, 300 enabled: CONFIG.FOLLOWERS.INSTANCE.ENABLED,
301 manualApproval: CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL 301 manualApproval: CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL
302 } 302 }
303 },
304 followings: {
305 instance: {
306 autoFollowBack: {
307 enabled: CONFIG.FOLLOWINGS.INSTANCE.AUTO_FOLLOW_BACK.ENABLED
308 },
309
310 autoFollowIndex: {
311 enabled: CONFIG.FOLLOWINGS.INSTANCE.AUTO_FOLLOW_INDEX.ENABLED,
312 indexUrl: CONFIG.FOLLOWINGS.INSTANCE.AUTO_FOLLOW_INDEX.INDEX_URL
313 }
314 }
303 } 315 }
304 } 316 }
305} 317}
diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts
index d38ce91de..37647622b 100644
--- a/server/controllers/api/server/follows.ts
+++ b/server/controllers/api/server/follows.ts
@@ -25,6 +25,7 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
25import { JobQueue } from '../../../lib/job-queue' 25import { JobQueue } from '../../../lib/job-queue'
26import { removeRedundancyOf } from '../../../lib/redundancy' 26import { removeRedundancyOf } from '../../../lib/redundancy'
27import { sequelizeTypescript } from '../../../initializers/database' 27import { sequelizeTypescript } from '../../../initializers/database'
28import { autoFollowBackIfNeeded } from '../../../lib/activitypub/follow'
28 29
29const serverFollowsRouter = express.Router() 30const serverFollowsRouter = express.Router()
30serverFollowsRouter.get('/following', 31serverFollowsRouter.get('/following',
@@ -172,5 +173,7 @@ async function acceptFollower (req: express.Request, res: express.Response) {
172 follow.state = 'accepted' 173 follow.state = 'accepted'
173 await follow.save() 174 await follow.save()
174 175
176 await autoFollowBackIfNeeded(follow)
177
175 return res.status(204).end() 178 return res.status(204).end()
176} 179}
diff --git a/server/controllers/api/users/my-notifications.ts b/server/controllers/api/users/my-notifications.ts
index f146284e4..017f5219e 100644
--- a/server/controllers/api/users/my-notifications.ts
+++ b/server/controllers/api/users/my-notifications.ts
@@ -76,7 +76,8 @@ async function updateNotificationSettings (req: express.Request, res: express.Re
76 newFollow: body.newFollow, 76 newFollow: body.newFollow,
77 newUserRegistration: body.newUserRegistration, 77 newUserRegistration: body.newUserRegistration,
78 commentMention: body.commentMention, 78 commentMention: body.commentMention,
79 newInstanceFollower: body.newInstanceFollower 79 newInstanceFollower: body.newInstanceFollower,
80 autoInstanceFollowing: body.autoInstanceFollowing
80 } 81 }
81 82
82 await UserNotificationSettingModel.update(values, query) 83 await UserNotificationSettingModel.update(values, query)