perf(stream): 必要のない既読処理のメッセージが発生しないように (MisskeyIO#907)
This commit is contained in:
parent
8821e3e81b
commit
c4fafbdca7
11 changed files with 50 additions and 13 deletions
|
@ -51,6 +51,10 @@ class AntennaChannel extends Channel {
|
|||
|
||||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -59,7 +63,6 @@ class AntennaChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -57,6 +57,10 @@ class ChannelChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -65,7 +69,6 @@ class ChannelChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,6 +87,10 @@ class GlobalTimelineChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -95,7 +99,6 @@ class GlobalTimelineChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,9 @@ class HashtagChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
this.connection.cacheNote(note);
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
this.send('note', note);
|
||||
}
|
||||
|
|
|
@ -91,6 +91,10 @@ class HomeTimelineChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -99,7 +103,6 @@ class HomeTimelineChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,10 @@ class HybridTimelineChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -113,7 +117,6 @@ class HybridTimelineChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,10 @@ class LocalTimelineChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -98,7 +102,6 @@ class LocalTimelineChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,11 @@ class MainChannel extends Channel {
|
|||
const note = await this.noteEntityService.pack(data.body.note.id, this.user, {
|
||||
detail: true,
|
||||
});
|
||||
this.connection.cacheNote(note);
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
data.body.note = note;
|
||||
}
|
||||
break;
|
||||
|
@ -51,7 +55,11 @@ class MainChannel extends Channel {
|
|||
const note = await this.noteEntityService.pack(data.body.id, this.user, {
|
||||
detail: true,
|
||||
});
|
||||
this.connection.cacheNote(note);
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
data.body = note;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -73,6 +73,10 @@ class RoleTimelineChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -81,7 +85,6 @@ class RoleTimelineChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -130,6 +130,10 @@ class UserListChannel extends Channel {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.user && (note.visibleUserIds?.includes(this.user.id) ?? note.mentions?.includes(this.user.id))) {
|
||||
this.connection.cacheNote(note);
|
||||
}
|
||||
|
||||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
|
@ -138,7 +142,6 @@ class UserListChannel extends Channel {
|
|||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
this.send('note', note);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue