don't broadcast poll updates

This commit is contained in:
Namekuji 2023-06-18 12:51:51 -04:00
parent caf696a5ec
commit 284c0c58c4
3 changed files with 5 additions and 10 deletions

View File

@ -1,9 +1,9 @@
import type Bull from "bull"; import type Bull from "bull";
import { In } from "typeorm"; import { Notes, PollVotes } from "@/models/index.js";
import { Notes, Polls, PollVotes } from "@/models/index.js";
import { queueLogger } from "../logger.js"; import { queueLogger } from "../logger.js";
import type { EndedPollNotificationJobData } from "@/queue/types.js"; import type { EndedPollNotificationJobData } from "@/queue/types.js";
import { createNotification } from "@/services/create-notification.js"; import { createNotification } from "@/services/create-notification.js";
import { deliverQuestionUpdate } from "@/services/note/polls/update.js";
const logger = queueLogger.createSubLogger("ended-poll-notification"); 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(); done();
} }

View File

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

View File

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