Skip to content

Commit

Permalink
await deliver
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Apr 5, 2024
1 parent ed0cc11 commit a42e7eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/remote/activitypub/deliver-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,13 @@ export default class DeliverManager {

if (await isSelfSilencedHost(host)) {
const act = publicToHome(this.activity, this.actor);
deliver(this.actor, act, inbox.url, lowSeverity, inbox);
await deliver(this.actor, act, inbox.url, lowSeverity, inbox);
} else {
deliver(this.actor, this.activity, inbox.url, lowSeverity, inbox);
await deliver(this.actor, this.activity, inbox.url, lowSeverity, inbox);
}

} catch { }
} catch (e) {
console.warn(`deliver failed ${e}`);
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/services/suspend-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ export async function sendDeleteActivity(user: IUser) {
]) as { _id: string }[];

for (const inbox of results.map(x => x._id)) {
deliver(user as any, content, inbox);
try {
await deliver(user as any, content, inbox);
} catch (e) {
console.warn(`deliver failed ${e}`);
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/services/unsuspend-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export async function doPostUnsuspend(user: IUser) {
]) as { _id: string }[];

for (const inbox of results.map(x => x._id)) {
deliver(user as any, content, inbox);
try {
await deliver(user as any, content, inbox);
} catch (e) {
console.warn(`deliver failed ${e}`);
}
}
}
}

0 comments on commit a42e7eb

Please sign in to comment.