mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-08 04:54:32 +00:00
update user activity on Renote, Un-Renote, Note Edit, React, and Un-React
This commit is contained in:
parent
b22b5577b4
commit
b4bce57fcb
4 changed files with 10 additions and 0 deletions
|
@ -592,6 +592,8 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
if (!this.isRenote(note) || this.isQuote(note)) {
|
if (!this.isRenote(note) || this.isQuote(note)) {
|
||||||
// Increment notes count (user)
|
// Increment notes count (user)
|
||||||
this.incNotesCountOfUser(user);
|
this.incNotesCountOfUser(user);
|
||||||
|
} else {
|
||||||
|
this.usersRepository.update({ id: user.id }, { updatedAt: new Date() });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pushToTl(note, user);
|
this.pushToTl(note, user);
|
||||||
|
|
|
@ -127,6 +127,8 @@ export class NoteDeleteService {
|
||||||
if (!isRenote(note) || isQuote(note)) {
|
if (!isRenote(note) || isQuote(note)) {
|
||||||
// Decrement notes count (user)
|
// Decrement notes count (user)
|
||||||
this.decNotesCountOfUser(user);
|
this.decNotesCountOfUser(user);
|
||||||
|
} else {
|
||||||
|
this.usersRepository.update({ id: user.id }, { updatedAt: new Date() });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.meta.enableStatsForFederatedInstances) {
|
if (this.meta.enableStatsForFederatedInstances) {
|
||||||
|
|
|
@ -610,6 +610,8 @@ export class NoteEditService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.usersRepository.update({ id: user.id }, { updatedAt: new Date() });
|
||||||
|
|
||||||
// ハッシュタグ更新
|
// ハッシュタグ更新
|
||||||
this.pushToTl(note, user);
|
this.pushToTl(note, user);
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,8 @@ export class ReactionService {
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.usersRepository.update({ id: user.id }, { updatedAt: new Date() });
|
||||||
|
|
||||||
// 30%の確率、セルフではない、3日以内に投稿されたノートの場合ハイライト用ランキング更新
|
// 30%の確率、セルフではない、3日以内に投稿されたノートの場合ハイライト用ランキング更新
|
||||||
if (
|
if (
|
||||||
Math.random() < 0.3 &&
|
Math.random() < 0.3 &&
|
||||||
|
@ -330,6 +332,8 @@ export class ReactionService {
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.usersRepository.update({ id: user.id }, { updatedAt: new Date() });
|
||||||
|
|
||||||
this.globalEventService.publishNoteStream(note.id, 'unreacted', {
|
this.globalEventService.publishNoteStream(note.id, 'unreacted', {
|
||||||
reaction: this.decodeReaction(exist.reaction).reaction,
|
reaction: this.decodeReaction(exist.reaction).reaction,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue