mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-14 06:25:52 +02:00
Merge commit from fork
Co-authored-by: Julia Johannesen <197614925+juliajohannesen@users.noreply.github.com>
This commit is contained in:
@@ -155,7 +155,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
const index = ps.choice + 1; // In SQL, array index is 1 based
|
||||
await this.pollsRepository.query(`UPDATE poll SET votes[${index}] = votes[${index}] + 1 WHERE "noteId" = '${poll.noteId}'`);
|
||||
|
||||
this.globalEventService.publishNoteStream(note.id, 'pollVoted', {
|
||||
this.globalEventService.publishNoteStream(note, 'pollVoted', {
|
||||
choice: ps.choice,
|
||||
userId: me.id,
|
||||
});
|
||||
|
||||
@@ -206,6 +206,14 @@ export default class Connection {
|
||||
|
||||
@bindThis
|
||||
private async onNoteStreamMessage(data: GlobalEvents['note']['payload']) {
|
||||
if (data.body.visibility === 'specified' && !data.body.visibleUserIds.includes(this.user!.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.body.visibility === 'followers' && !Object.hasOwn(this.following, data.body.userId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendMessageToWs('noteUpdated', {
|
||||
id: data.body.id,
|
||||
type: data.type,
|
||||
|
||||
Reference in New Issue
Block a user