Implement featured note injection

This commit is contained in:
syuilo
2020-02-18 19:05:11 +09:00
parent 3d79e7a136
commit d9986b7a2f
19 changed files with 117 additions and 16 deletions

View File

@ -125,6 +125,11 @@ export class UserProfile {
})
public carefulBot: boolean;
@Column('boolean', {
default: true,
})
public injectFeaturedNote: boolean;
@Column({
...id(),
nullable: true

View File

@ -196,7 +196,8 @@ export class NoteRepository extends Repository<Note> {
renoteId: note.renoteId,
mentions: note.mentions.length > 0 ? note.mentions : undefined,
uri: note.uri || undefined,
_prInjectionId_: (note as any)._prInjectionId_ || undefined,
_featuredId_: (note as any)._featuredId_ || undefined,
_prId_: (note as any)._prId_ || undefined,
...(opts.detail ? {
reply: note.replyId ? this.pack(note.replyId, meId, {

View File

@ -227,6 +227,7 @@ export class UserRepository extends Repository<User> {
avatarId: user.avatarId,
bannerId: user.bannerId,
autoWatch: profile!.autoWatch,
injectFeaturedNote: profile!.injectFeaturedNote,
alwaysMarkNsfw: profile!.alwaysMarkNsfw,
carefulBot: profile!.carefulBot,
autoAcceptFollowed: profile!.autoAcceptFollowed,