thank you linters

This commit is contained in:
dakkar 2024-10-11 12:20:08 +01:00
parent 3cec5f927e
commit fb9b6b1208
8 changed files with 36 additions and 12 deletions

View file

@ -155,8 +155,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
notes = notes.filter(note => {
if (note.user?.isSilenced && me && followings && note.userId !== me.id && !followings[note.userId]) return false;
if (note.user?.isSuspended) return false;
if (this.utilityService.isFederationAllowedHost(note.userHost)) return false;
if (this.utilityService.isSilencedHost(this.serverSettings.silencedHosts, note.userHost)) return false;
if (note.userHost) {
if (this.utilityService.isFederationAllowedHost(note.userHost)) return false;
if (this.utilityService.isSilencedHost(this.serverSettings.silencedHosts, note.userHost)) return false;
}
return true;
});

View file

@ -5,7 +5,6 @@
import { Inject, Injectable } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
import type { MiMeta } from '@/models/_.js';
import type { Packed } from '@/misc/json-schema.js';
import { MetaService } from '@/core/MetaService.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
@ -23,11 +22,10 @@ class BubbleTimelineChannel extends Channel {
private withRenotes: boolean;
private withFiles: boolean;
private withBots: boolean;
private instance: MiMeta;
constructor(
@Inject(DI.meta)
private serverSettings: MiMeta,
private metaService: MetaService,
private roleService: RoleService,
private noteEntityService: NoteEntityService,
@ -46,6 +44,7 @@ class BubbleTimelineChannel extends Channel {
this.withRenotes = !!(params.withRenotes ?? true);
this.withFiles = !!(params.withFiles ?? false);
this.withBots = !!(params.withBots ?? true);
this.instance = await this.metaService.fetch();
// Subscribe events
this.subscriber.on('notesStream', this.onNote);
@ -56,7 +55,7 @@ class BubbleTimelineChannel extends Channel {
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (!this.withBots && note.user.isBot) return;
if (!(note.user.host != null && this.serverSettings.bubbleInstances.includes(note.user.host) && note.visibility === 'public' )) return;
if (!(note.user.host != null && this.instance.bubbleInstances.includes(note.user.host) && note.visibility === 'public' )) return;
if (note.channelId != null) return;

View file

@ -160,7 +160,7 @@ export class ClientServerService {
}, {
// 空文字列の場合右辺を使いたいため
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
'src': instance.app512IconUrl || '/static-assets/icons/512.png',
'src': this.meta.app512IconUrl || '/static-assets/icons/512.png',
'sizes': '300x300',
'type': 'image/png',
'purpose': 'any',