summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/users/lists
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-03-11 19:57:50 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-03-11 19:57:50 +0900
commite47c3549168237d8b9824e67cc534f53495d7845 (patch)
tree56a6c3079201caa609c24d6a807217382d3de2f8 /src/server/api/endpoints/users/lists
parentリストをインポートしたときにプロキシアカウントがフ... (diff)
downloadsharkey-e47c3549168237d8b9824e67cc534f53495d7845.tar.gz
sharkey-e47c3549168237d8b9824e67cc534f53495d7845.tar.bz2
sharkey-e47c3549168237d8b9824e67cc534f53495d7845.zip
Refactor
Diffstat (limited to 'src/server/api/endpoints/users/lists')
-rw-r--r--src/server/api/endpoints/users/lists/push.ts21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/server/api/endpoints/users/lists/push.ts b/src/server/api/endpoints/users/lists/push.ts
index 6b47f9dc71..eea2f39a8c 100644
--- a/src/server/api/endpoints/users/lists/push.ts
+++ b/src/server/api/endpoints/users/lists/push.ts
@@ -1,14 +1,10 @@
import $ from 'cafy';
import ID, { transform } from '../../../../../misc/cafy-id';
import UserList from '../../../../../models/user-list';
-import { pack as packUser, isRemoteUser, fetchProxyAccount } from '../../../../../models/user';
-import { publishUserListStream } from '../../../../../services/stream';
-import { renderActivity } from '../../../../../remote/activitypub/renderer';
-import renderFollow from '../../../../../remote/activitypub/renderer/follow';
-import { deliver } from '../../../../../queue';
import define from '../../../define';
import { ApiError } from '../../../error';
import { getUser } from '../../../common/getters';
+import { pushUserToUserList } from '../../../../../services/user-list/push';
export const meta = {
desc: {
@@ -81,18 +77,5 @@ export default define(meta, async (ps, me) => {
}
// Push the user
- await UserList.update({ _id: userList._id }, {
- $push: {
- userIds: user._id
- }
- });
-
- publishUserListStream(userList._id, 'userAdded', await packUser(user));
-
- // このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする
- if (isRemoteUser(user)) {
- const proxy = await fetchProxyAccount();
- const content = renderActivity(renderFollow(proxy, user));
- deliver(proxy, content, user.inbox);
- }
+ pushUserToUserList(user, userList);
});