parent
037837b551
commit
0e4a111f81
1714 changed files with 20803 additions and 11751 deletions
|
|
@ -1,27 +0,0 @@
|
|||
import { publishUserListStream } from '@/services/stream';
|
||||
import { User } from '@/models/entities/user';
|
||||
import { UserList } from '@/models/entities/user-list';
|
||||
import { UserListJoinings, Users } from '@/models/index';
|
||||
import { UserListJoining } from '@/models/entities/user-list-joining';
|
||||
import { genId } from '@/misc/gen-id';
|
||||
import { fetchProxyAccount } from '@/misc/fetch-proxy-account';
|
||||
import createFollowing from '../following/create';
|
||||
|
||||
export async function pushUserToUserList(target: User, list: UserList) {
|
||||
await UserListJoinings.insert({
|
||||
id: genId(),
|
||||
createdAt: new Date(),
|
||||
userId: target.id,
|
||||
userListId: list.id
|
||||
} as UserListJoining);
|
||||
|
||||
publishUserListStream(list.id, 'userAdded', await Users.pack(target));
|
||||
|
||||
// このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする
|
||||
if (Users.isRemoteUser(target)) {
|
||||
const proxy = await fetchProxyAccount();
|
||||
if (proxy) {
|
||||
createFollowing(proxy, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue