Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CGsama committed Jan 26, 2025
1 parent e5d178d commit 81c07bd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/backend/src/server/web/FeedService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common';
import { In, IsNull } from 'typeorm';
import { Feed } from 'feed';
import { DI } from '@/di-symbols.js';
import type { DriveFilesRepository, NotesRepository, UserProfilesRepository } from '@/models/_.js';
import type { DriveFilesRepository, NotesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js';
import type { Config } from '@/config.js';
import type { MiUser } from '@/models/User.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
Expand All @@ -30,6 +30,9 @@ export class FeedService {
@Inject(DI.config)
private config: Config,

@Inject(DI.usersRepository)
private usersRepository: UsersRepository,

@Inject(DI.userProfilesRepository)
private userProfilesRepository: UserProfilesRepository,

Expand Down Expand Up @@ -88,7 +91,7 @@ export class FeedService {
let contentStr = await this.noteToString(note, true);
let next = note.renoteId ? note.renoteId : note.replyId;
let depth = 10;
let noteintitle = true;
const noteintitle = true;
let title = `Post by ${author.name}`;
while (depth > 0 && next) {
const finding = await this.findById(next);
Expand Down Expand Up @@ -133,7 +136,7 @@ export class FeedService {
this.logger.info(`note2str ${note.userId} ${note.text}`);
const author = isTheNote
? null
: await this.userProfilesRepository.findOneByOrFail({ userId: note.userId });
: await this.usersRepository.findOneByOrFail({ id: note.userId });
let outstr = author
? `${author.name}(@${author.username}@${
author.host ? author.host : this.config.host
Expand Down Expand Up @@ -176,7 +179,7 @@ export class FeedService {
return outstr;
}

private async findById(id : String) {
private async findById(id : string) {
let text = "";
let next = null;
const findings = await this.notesRepository.findOneBy({
Expand Down

0 comments on commit 81c07bd

Please sign in to comment.