Implement Update Question (#4435)

* Update remote votes count

* save updatedAt

* deliver Update

* use renderNote

* use id

* fix typeof
This commit is contained in:
MeiMei
2019-03-07 21:19:32 +09:00
committed by syuilo
parent a485061e22
commit 7325d66c52
10 changed files with 197 additions and 18 deletions

View File

@@ -18,6 +18,7 @@ import { extractPollFromQuestion } from './question';
import vote from '../../../services/note/polls/vote';
import { apLogger } from '../logger';
import { IDriveFile } from '../../../models/drive-file';
import { deliverQuestionUpdate } from '../../../services/note/polls/update';
const logger = apLogger;
@@ -136,6 +137,9 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
} else if (index >= 0) {
logger.info(`vote from AP: actor=${actor.username}@${actor.host}, note=${note.id}, choice=${name}`);
await vote(actor, reply, index);
// リモートフォロワーにUpdate配信
deliverQuestionUpdate(reply._id);
}
return null;
};