diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-14 00:39:50 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-14 00:39:50 +0900 |
| commit | 97f75cea52154788e136fb63c484d86bf75f2041 (patch) | |
| tree | baf719c55a1db333237651b986ac1a6b06c6e799 /src | |
| parent | Kill child process on exit (diff) | |
| parent | Fix #1887 (diff) | |
| download | sharkey-97f75cea52154788e136fb63c484d86bf75f2041.tar.gz sharkey-97f75cea52154788e136fb63c484d86bf75f2041.tar.bz2 sharkey-97f75cea52154788e136fb63c484d86bf75f2041.zip | |
Merge branch 'master' of aya.github:syuilo/misskey
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/api/endpoints/notes/hybrid-timeline.ts | 3 | ||||
| -rw-r--r-- | src/services/note/create.ts | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/server/api/endpoints/notes/hybrid-timeline.ts b/src/server/api/endpoints/notes/hybrid-timeline.ts index c9b352fe8e..8b3537bb1e 100644 --- a/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -124,6 +124,9 @@ export default async (params: any, user: ILocalUser) => { // フォローしている人の投稿 $or: followQuery }, { + // public only + visibility: 'public', + // local '_user.host': null }], diff --git a/src/services/note/create.ts b/src/services/note/create.ts index d29b628119..d4daa6f477 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -269,6 +269,8 @@ export default async (user: IUser, data: { // Publish note to local and hybrid timeline stream if (note.visibility != 'home') { publishLocalTimelineStream(noteObj); + } + if (note.visibility == 'public') { publishHybridTimelineStream(null, noteObj); } } @@ -281,9 +283,11 @@ export default async (user: IUser, data: { if (note.visibility == 'specified') { data.visibleUsers.forEach(async u => { - stream(u._id, 'note', await pack(note, u, { + const n = await pack(note, u, { detail: true - })); + }); + stream(u._id, 'note', n); + publishHybridTimelineStream(u._id, n); }); } @@ -304,10 +308,7 @@ export default async (user: IUser, data: { // Publish event to followers stream stream(following.followerId, 'note', noteObj); - - if (isRemoteUser(user)) { - publishHybridTimelineStream(following.followerId, noteObj); - } + publishHybridTimelineStream(following.followerId, noteObj); } else { //#region AP配送 // フォロワーがリモートユーザーかつ投稿者がローカルユーザーなら投稿を配信 |