forked from woem.men/forkey
enhance(data-usage): ストリーム上で送るデータがない場合はオブジェクトごと省略するように (MisskeyIO#853)
This commit is contained in:
parent
84505cb7ad
commit
7bbbbd0b89
8 changed files with 24 additions and 24 deletions
|
@ -54,9 +54,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);
|
||||
|
|
|
@ -60,9 +60,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);
|
||||
|
|
|
@ -90,9 +90,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);
|
||||
|
|
|
@ -94,9 +94,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);
|
||||
|
|
|
@ -108,9 +108,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);
|
||||
|
|
|
@ -93,9 +93,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);
|
||||
|
|
|
@ -76,9 +76,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.connection.cacheNote(note);
|
||||
|
|
|
@ -133,9 +133,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 a new issue