fix queue?
This commit is contained in:
parent
cce58503e4
commit
964fdefdae
|
@ -48,15 +48,15 @@ export default async (actor: CacheableRemoteUser, activity: IMove): Promise<stri
|
||||||
await updatePerson(newUri);
|
await updatePerson(newUri);
|
||||||
await updatePerson(oldUri);
|
await updatePerson(oldUri);
|
||||||
|
|
||||||
new_acc = await getRemoteUser(newUri);
|
new_acc = await dbResolver.getUserFromApId(newUri);
|
||||||
old_acc = await getRemoteUser(oldUri);
|
let old = await dbResolver.getUserFromApId(oldUri);
|
||||||
|
|
||||||
if (old_acc === null || old_acc.uri === null || !new_acc.alsoKnownAs?.includes(old_acc.uri)) return 'move: accounts invalid';
|
if (old === null || old.uri === null || !new_acc?.alsoKnownAs?.includes(old.uri)) return 'move: accounts invalid';
|
||||||
|
|
||||||
old_acc.movedToUri = new_acc.uri;
|
old.movedToUri = new_acc.uri;
|
||||||
|
|
||||||
const query = Followings.createQueryBuilder('following')
|
const query = Followings.createQueryBuilder('following')
|
||||||
.where('following.followeeId = :userId', { userId: old_acc.id });
|
.where('following.followeeId = :userId', { userId: old.id });
|
||||||
|
|
||||||
const followings = await query
|
const followings = await query
|
||||||
.getMany();
|
.getMany();
|
||||||
|
@ -64,7 +64,7 @@ export default async (actor: CacheableRemoteUser, activity: IMove): Promise<stri
|
||||||
followings.forEach(async following => {
|
followings.forEach(async following => {
|
||||||
if (following.follower?.host) {
|
if (following.follower?.host) {
|
||||||
const follower = following.follower;
|
const follower = following.follower;
|
||||||
await deleteFollowing(follower!, old_acc!);
|
await deleteFollowing(follower!, old!);
|
||||||
try {
|
try {
|
||||||
await create(follower!, new_acc!);
|
await create(follower!, new_acc!);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue