Skip to content
Snippets Groups Projects
Commit 0ba5dc39 authored by syuilo's avatar syuilo
Browse files

Only show local posts in the timeline of top page

parent 872717fe
No related merge requests found
......@@ -37,6 +37,7 @@ export default Vue.extend({
fetch(cb?) {
this.fetching = true;
(this as any).api('notes', {
local: true,
reply: false,
renote: false,
media: false,
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment