Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { publishUserEvent, publishUserListStream } from "../stream.js";
|
||||
import { UserListJoinings, Users } from "../../models/index.js";
|
||||
import { genId } from "../../misc/gen-id.js";
|
||||
export async function pushUserToUserList(target, list) {
|
||||
await UserListJoinings.insert({
|
||||
id: genId(),
|
||||
createdAt: new Date(),
|
||||
userId: target.id,
|
||||
userListId: list.id
|
||||
});
|
||||
const packed = await Users.pack(target);
|
||||
publishUserListStream(list.id, "userAdded", packed);
|
||||
if (list.hideFromHomeTl) publishUserEvent(list.userId, "userHidden", target.id);
|
||||
}
|
||||
Reference in New Issue
Block a user