mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 03:43:07 +02:00
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))');
|
||||
|
|
|
@ -17,6 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<option value="federating">{{ i18n.ts.federating }}</option>
|
||||
<option value="subscribing">{{ i18n.ts.subscribing }}</option>
|
||||
<option value="publishing">{{ i18n.ts.publishing }}</option>
|
||||
<option value="bubble">Bubble</option>
|
||||
<option value="nsfw">NSFW</option>
|
||||
<option value="suspended">{{ i18n.ts.suspended }}</option>
|
||||
<option value="silenced">{{ i18n.ts.silence }}</option>
|
||||
|
@ -80,6 +81,7 @@ const pagination = {
|
|||
state.value === 'silenced' ? { silenced: true } :
|
||||
state.value === 'notResponding' ? { notResponding: true } :
|
||||
state.value === 'nsfw' ? { nsfw: true } :
|
||||
state.value === 'bubble' ? { nsfw: true } :
|
||||
{}),
|
||||
})),
|
||||
} as Paging;
|
||||
|
|
Loading…
Reference in a new issue