summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-05-26 12:35:14 +0900
committerGitHub <noreply@github.com>2018-05-26 12:35:14 +0900
commitbc9487822529b260fbdc9a8dcca35c3da25db04e (patch)
treed5fd0dffb95e03b95df8e98692305d75f855e645 /src/server/api/endpoints/notes.ts
parentNew translations ja.yml (Portuguese) (diff)
parentMerge pull request #1649 from l2dy/i18n (diff)
downloadmisskey-bc9487822529b260fbdc9a8dcca35c3da25db04e.tar.gz
misskey-bc9487822529b260fbdc9a8dcca35c3da25db04e.tar.bz2
misskey-bc9487822529b260fbdc9a8dcca35c3da25db04e.zip
Merge branch 'master' into l10n_master
Diffstat (limited to 'src/server/api/endpoints/notes.ts')
-rw-r--r--src/server/api/endpoints/notes.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/api/endpoints/notes.ts b/src/server/api/endpoints/notes.ts
index 4ce7613d70..21946d1bd3 100644
--- a/src/server/api/endpoints/notes.ts
+++ b/src/server/api/endpoints/notes.ts
@@ -8,6 +8,10 @@ import Note, { pack } from '../../../models/note';
* Get all notes
*/
module.exports = (params) => new Promise(async (res, rej) => {
+ // Get 'local' parameter
+ const [local, localErr] = $.bool.optional().get(params.local);
+ if (localErr) return rej('invalid local param');
+
// Get 'reply' parameter
const [reply, replyErr] = $.bool.optional().get(params.reply);
if (replyErr) return rej('invalid reply param');
@@ -61,6 +65,10 @@ module.exports = (params) => new Promise(async (res, rej) => {
};
}
+ if (local) {
+ query['_user.host'] = null;
+ }
+
if (reply != undefined) {
query.replyId = reply ? { $exists: true, $ne: null } : null;
}