don't broadcast poll updates

This commit is contained in:
Namekuji 2023-06-18 12:51:51 -04:00
parent 020c4f5788
commit 68cc264f5f
No known key found for this signature in database
GPG key ID: B541BD6E646CABC7
3 changed files with 5 additions and 10 deletions

View file

@ -1,9 +1,9 @@
import type Bull from "bull";
import { In } from "typeorm";
import { Notes, Polls, PollVotes } from "@/models/index.js";
import { Notes, PollVotes } from "@/models/index.js";
import { queueLogger } from "../logger.js";
import type { EndedPollNotificationJobData } from "@/queue/types.js";
import { createNotification } from "@/services/create-notification.js";
import { deliverQuestionUpdate } from "@/services/note/polls/update.js";
const logger = queueLogger.createSubLogger("ended-poll-notification");
@ -32,5 +32,8 @@ export async function endedPollNotification(
});
}
// Broadcast the poll result once it ends
await deliverQuestionUpdate(note.id);
done();
}

View file

@ -17,7 +17,6 @@ import { extractPollFromQuestion, updateQuestion } from "./question.js";
import vote from "@/services/note/polls/vote.js";
import { apLogger } from "../logger.js";
import { DriveFile } from "@/models/entities/drive-file.js";
import { deliverQuestionUpdate } from "@/services/note/polls/update.js";
import { extractDbHost, toPuny } from "@/misc/convert-host.js";
import {
Emojis,
@ -334,9 +333,6 @@ export async function createNote(
`vote from AP: actor=${actor.username}@${actor.host}, note=${note.id}, choice=${name}`,
);
await vote(actor, reply, index);
// リモートフォロワーにUpdate配信
deliverQuestionUpdate(reply.id);
}
return null;
};

View file

@ -4,7 +4,6 @@ import { createNotification } from "@/services/create-notification.js";
import { deliver } from "@/queue/index.js";
import { renderActivity } from "@/remote/activitypub/renderer/index.js";
import renderVote from "@/remote/activitypub/renderer/vote.js";
import { deliverQuestionUpdate } from "@/services/note/polls/update.js";
import {
PollVotes,
NoteWatchings,
@ -178,7 +177,4 @@ export default define(meta, paramDef, async (ps, user) => {
pollOwner.inbox,
);
}
// リモートフォロワーにUpdate配信
deliverQuestionUpdate(note.id);
});