fix: ignore if post boosted by relay is local

This commit is contained in:
Namekuji 2023-06-30 18:13:07 -04:00
parent e70d99be57
commit 389427af27

View file

@ -472,7 +472,8 @@ export default async (
.map((relay) => new URL(relay.inbox).host) .map((relay) => new URL(relay.inbox).host)
.includes(note.userHost); .includes(note.userHost);
if (boostedByRelay && data.renote) { if (boostedByRelay && data.renote && data.renote.userHost) {
/* A relay boosted a remote post. */
// Use Redis transaction for atomicity // Use Redis transaction for atomicity
const key = `publishedNote:${data.renote.id}`; const key = `publishedNote:${data.renote.id}`;
await redisClient.watch(key); await redisClient.watch(key);