server: fix some TS warnings

This commit is contained in:
Johann150 2024-04-01 18:26:15 +02:00
parent 5444ca9aca
commit 7458550f7a
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
3 changed files with 7 additions and 7 deletions

View file

@ -2,7 +2,6 @@ import { URL } from 'node:url';
import Bull from 'bull'; import Bull from 'bull';
import { request } from '@/remote/activitypub/request.js'; import { request } from '@/remote/activitypub/request.js';
import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc.js'; import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instance-doc.js';
import Logger from '@/services/logger.js';
import { Instances } from '@/models/index.js'; import { Instances } from '@/models/index.js';
import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js'; import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js';
import { toPuny } from '@/misc/convert-host.js'; import { toPuny } from '@/misc/convert-host.js';
@ -11,8 +10,6 @@ import { getUserKeypair } from '@/misc/keypair-store.js';
import { shouldSkipInstance } from '@/misc/skipped-instances.js'; import { shouldSkipInstance } from '@/misc/skipped-instances.js';
import { DeliverJobData } from '@/queue/types.js'; import { DeliverJobData } from '@/queue/types.js';
const logger = new Logger('deliver');
export default async (job: Bull.Job<DeliverJobData>) => { export default async (job: Bull.Job<DeliverJobData>) => {
const { host } = new URL(job.data.to); const { host } = new URL(job.data.to);
const puny = toPuny(host); const puny = toPuny(host);

View file

@ -193,13 +193,15 @@ export async function sideEffects(user: User, note: Note, silent = false, create
} }
// Word mute // Word mute
mutedWordsCache.fetch('').then(us => { mutedWordsCache.fetch('').then(users => {
for (const u of us) { if (users == null) return;
checkWordMute(note, { id: u.userId }, u.mutedWords).then(shouldMute => {
for (const user of users) {
checkWordMute(note, { id: user.userId }, user.mutedWords).then(shouldMute => {
if (shouldMute) { if (shouldMute) {
MutedNotes.insert({ MutedNotes.insert({
id: genId(), id: genId(),
userId: u.userId, userId: user.userId,
noteId: note.id, noteId: note.id,
reason: 'word', reason: 'word',
}); });

View file

@ -1,5 +1,6 @@
import { IsNull } from 'typeorm'; import { IsNull } from 'typeorm';
import { ILocalUser, User } from '@/models/entities/user.js'; import { ILocalUser, User } from '@/models/entities/user.js';
import { UserPublickey } from '@/models/entities/user-publickey.js';
import { Users, UserPublickeys } from '@/models/index.js'; import { Users, UserPublickeys } from '@/models/index.js';
import { Cache } from '@/misc/cache.js'; import { Cache } from '@/misc/cache.js';
import { subscriber } from '@/db/redis.js'; import { subscriber } from '@/db/redis.js';