diff options
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/server/follows.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts index 4b54afc8d..391f8bdca 100644 --- a/server/controllers/api/server/follows.ts +++ b/server/controllers/api/server/follows.ts | |||
@@ -1,11 +1,15 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserRight } from '../../../../shared/models/users/user-right.enum' | 2 | import { UserRight } from '../../../../shared/models/users/user-right.enum' |
3 | import { getFormattedObjects } from '../../../helpers' | 3 | import { getFormattedObjects } from '../../../helpers' |
4 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | ||
4 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
5 | import { getServerAccount } from '../../../helpers/utils' | 6 | import { getServerAccount } from '../../../helpers/utils' |
6 | import { getAccountFromWebfinger } from '../../../helpers/webfinger' | 7 | import { getAccountFromWebfinger } from '../../../helpers/webfinger' |
7 | import { SERVER_ACCOUNT_NAME } from '../../../initializers/constants' | 8 | import { SERVER_ACCOUNT_NAME } from '../../../initializers/constants' |
8 | import { database as db } from '../../../initializers/database' | 9 | import { database as db } from '../../../initializers/database' |
10 | import { saveAccountAndServerIfNotExist } from '../../../lib/activitypub/account' | ||
11 | import { sendUndoFollow } from '../../../lib/activitypub/send/send-undo' | ||
12 | import { sendFollow } from '../../../lib/index' | ||
9 | import { asyncMiddleware, paginationValidator, removeFollowingValidator, setFollowersSort, setPagination } from '../../../middlewares' | 13 | import { asyncMiddleware, paginationValidator, removeFollowingValidator, setFollowersSort, setPagination } from '../../../middlewares' |
10 | import { authenticate } from '../../../middlewares/oauth' | 14 | import { authenticate } from '../../../middlewares/oauth' |
11 | import { setBodyHostsPort } from '../../../middlewares/servers' | 15 | import { setBodyHostsPort } from '../../../middlewares/servers' |
@@ -13,13 +17,8 @@ import { setFollowingSort } from '../../../middlewares/sort' | |||
13 | import { ensureUserHasRight } from '../../../middlewares/user-right' | 17 | import { ensureUserHasRight } from '../../../middlewares/user-right' |
14 | import { followValidator } from '../../../middlewares/validators/follows' | 18 | import { followValidator } from '../../../middlewares/validators/follows' |
15 | import { followersSortValidator, followingSortValidator } from '../../../middlewares/validators/sort' | 19 | import { followersSortValidator, followingSortValidator } from '../../../middlewares/validators/sort' |
16 | import { AccountFollowInstance } from '../../../models/index' | ||
17 | import { sendFollow } from '../../../lib/index' | ||
18 | import { sendUndoFollow } from '../../../lib/activitypub/send/send-undo' | ||
19 | import { AccountInstance } from '../../../models/account/account-interface' | 20 | import { AccountInstance } from '../../../models/account/account-interface' |
20 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 21 | import { AccountFollowInstance } from '../../../models/index' |
21 | import { saveAccountAndServerIfNotExist } from '../../../lib/activitypub/account' | ||
22 | import { addFetchOutboxJob } from '../../../lib/activitypub/fetch' | ||
23 | 22 | ||
24 | const serverFollowsRouter = express.Router() | 23 | const serverFollowsRouter = express.Router() |
25 | 24 | ||
@@ -137,8 +136,6 @@ async function follow (fromAccount: AccountInstance, targetAccount: AccountInsta | |||
137 | if (accountFollow.state === 'pending') { | 136 | if (accountFollow.state === 'pending') { |
138 | await sendFollow(accountFollow, t) | 137 | await sendFollow(accountFollow, t) |
139 | } | 138 | } |
140 | |||
141 | await addFetchOutboxJob(targetAccount, t) | ||
142 | }) | 139 | }) |
143 | } catch (err) { | 140 | } catch (err) { |
144 | // Reset target account | 141 | // Reset target account |