mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-21 16:33:48 +01:00
Revert "don't update if renoted by bot"
This reverts commit 49e9fb9001c25378aa396d2a1ccdac1e18456e14.
This commit is contained in:
parent
1e8c3c89da
commit
220b6f2011
@ -240,7 +240,7 @@ export async function createPerson(
|
||||
.map((tag) => normalizeForSearch(tag))
|
||||
.splice(0, 32);
|
||||
|
||||
const isBot = getApType(object) !== "Person";
|
||||
const isBot = getApType(object) === "Service";
|
||||
|
||||
const bday = person["vcard:bday"]?.match(/^\d{4}-\d{2}-\d{2}/);
|
||||
|
||||
@ -552,7 +552,7 @@ export async function updatePerson(
|
||||
emojis: emojiNames,
|
||||
name: truncate(person.name, nameLength),
|
||||
tags,
|
||||
isBot: getApType(object) !== "Person",
|
||||
isBot: getApType(object) === "Service",
|
||||
isCat: (person as any).isCat === true,
|
||||
isLocked: !!person.manuallyApprovesFollowers,
|
||||
movedToUri: person.movedTo || null,
|
||||
|
@ -30,11 +30,7 @@ export default class NotesChart extends Chart<typeof schema> {
|
||||
return {};
|
||||
}
|
||||
|
||||
public async update(
|
||||
note: Note,
|
||||
isAdditional: boolean,
|
||||
byBot = false,
|
||||
): Promise<void> {
|
||||
public async update(note: Note, isAdditional: boolean): Promise<void> {
|
||||
const prefix = note.userHost === null ? "local" : "remote";
|
||||
|
||||
await this.commit({
|
||||
@ -48,7 +44,7 @@ export default class NotesChart extends Chart<typeof schema> {
|
||||
: -1
|
||||
: 0,
|
||||
[`${prefix}.diffs.renote`]:
|
||||
note.renoteId != null && !byBot ? (isAdditional ? 1 : -1) : 0,
|
||||
note.renoteId != null ? (isAdditional ? 1 : -1) : 0,
|
||||
[`${prefix}.diffs.reply`]:
|
||||
note.replyId != null ? (isAdditional ? 1 : -1) : 0,
|
||||
[`${prefix}.diffs.withFile`]:
|
||||
|
@ -32,7 +32,6 @@ export default class PerUserNotesChart extends Chart<typeof schema> {
|
||||
user: { id: User["id"] },
|
||||
note: Note,
|
||||
isAdditional: boolean,
|
||||
byBot = false,
|
||||
): Promise<void> {
|
||||
await this.commit(
|
||||
{
|
||||
@ -45,8 +44,7 @@ export default class PerUserNotesChart extends Chart<typeof schema> {
|
||||
? 1
|
||||
: -1
|
||||
: 0,
|
||||
"diffs.renote":
|
||||
note.renoteId != null && !byBot ? (isAdditional ? 1 : -1) : 0,
|
||||
"diffs.renote": note.renoteId != null ? (isAdditional ? 1 : -1) : 0,
|
||||
"diffs.reply": note.replyId != null ? (isAdditional ? 1 : -1) : 0,
|
||||
"diffs.withFile": note.fileIds.length > 0 ? (isAdditional ? 1 : -1) : 0,
|
||||
},
|
||||
|
@ -163,7 +163,6 @@ export default async (
|
||||
host: User["host"];
|
||||
isSilenced: User["isSilenced"];
|
||||
createdAt: User["createdAt"];
|
||||
isBot: User["isBot"];
|
||||
inbox?: User["inbox"];
|
||||
},
|
||||
data: Option,
|
||||
@ -334,8 +333,8 @@ export default async (
|
||||
res(note);
|
||||
|
||||
// 統計を更新
|
||||
notesChart.update(note, true, user.isBot);
|
||||
perUserNotesChart.update(user, note, true, user.isBot);
|
||||
notesChart.update(note, true);
|
||||
perUserNotesChart.update(user, note, true);
|
||||
|
||||
// Register host
|
||||
if (Users.isRemoteUser(user)) {
|
||||
@ -410,7 +409,6 @@ export default async (
|
||||
// この投稿を除く指定したユーザーによる指定したノートのリノートが存在しないとき
|
||||
if (
|
||||
data.renote &&
|
||||
!user.isBot &&
|
||||
(await countSameRenotes(user.id, data.renote.id, note.id)) === 0
|
||||
) {
|
||||
incRenoteCount(data.renote);
|
||||
|
Loading…
Reference in New Issue
Block a user