enhance(data-usage): ストリーム上で送るデータがない場合はオブジェクトごと省略するように (MisskeyIO#853)
This commit is contained in:
parent
b7d80edcbb
commit
1ea5b86e71
|
@ -48,9 +48,9 @@ class AntennaChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
|
|
|
@ -54,9 +54,9 @@ class ChannelChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
|
|
|
@ -67,9 +67,9 @@ class GlobalTimelineChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
|
|
|
@ -91,9 +91,9 @@ class HomeTimelineChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
|
|
|
@ -106,9 +106,9 @@ class HybridTimelineChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
|
|
|
@ -77,9 +77,9 @@ class LocalTimelineChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
|
|
|
@ -53,9 +53,9 @@ class RoleTimelineChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.send('note', note);
|
||||
|
|
|
@ -123,9 +123,9 @@ class UserListChannel extends Channel {
|
|||
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
|
||||
this.send('note', {
|
||||
id: note.id, myReaction: note.myReaction,
|
||||
poll: note.poll ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
|
||||
poll: note.poll?.choices ? { choices: note.poll.choices } : undefined,
|
||||
reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined,
|
||||
renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined,
|
||||
});
|
||||
} else {
|
||||
this.connection.cacheNote(note);
|
||||
|
|
Loading…
Reference in New Issue