add filters for following feed
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import { PrimaryColumn, Entity, JoinColumn, Column, ManyToOne } from 'typeorm';
|
||||
import { MiUser } from '@/models/User.js';
|
||||
import { MiNote } from '@/models/Note.js';
|
||||
import { isQuote, isRenote } from '@/misc/is-renote.js';
|
||||
|
||||
/**
|
||||
* Maps a user to the most recent post by that user.
|
||||
@@ -69,4 +70,16 @@ export class SkLatestNote {
|
||||
(this as Record<string, unknown>)[k] = v;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a compound key matching a provided note.
|
||||
*/
|
||||
static keyFor(note: MiNote) {
|
||||
return {
|
||||
userId: note.userId,
|
||||
isPublic: note.visibility === 'public',
|
||||
isReply: note.replyId != null,
|
||||
isQuote: isRenote(note) && isQuote(note),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user