parent
81dea75eb7
commit
a1a57889fc
2 changed files with 20 additions and 0 deletions
|
@ -41,6 +41,7 @@ export const paramDef = {
|
|||
subscribing: { type: 'boolean', nullable: true },
|
||||
publishing: { type: 'boolean', nullable: true },
|
||||
nsfw: { type: 'boolean', nullable: true },
|
||||
bubble: { type: 'boolean', nullable: true },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
|
||||
offset: { type: 'integer', default: 0 },
|
||||
sort: {
|
||||
|
@ -148,6 +149,23 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
}
|
||||
|
||||
if (typeof ps.bubble === 'boolean') {
|
||||
const meta = await this.metaService.fetch(true);
|
||||
|
||||
if (ps.bubble) {
|
||||
if (meta.bubbleInstances.length === 0) {
|
||||
return [];
|
||||
}
|
||||
query.andWhere('instance.host IN (:...bubble)', {
|
||||
silences: meta.bubbleInstances,
|
||||
});
|
||||
} else if (meta.bubbleInstances.length > 0) {
|
||||
query.andWhere('instance.host NOT IN (:...bubble)', {
|
||||
bubble: meta.bubbleInstances,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof ps.federating === 'boolean') {
|
||||
if (ps.federating) {
|
||||
query.andWhere('((instance.followingCount > 0) OR (instance.followersCount > 0))');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue