summaryrefslogtreecommitdiff
path: root/src/services/note
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-01-21 12:19:20 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-01-21 12:19:20 +0900
commit6bbccedb2db040fb70ea0176e78bcb84daf9109e (patch)
treea9781d5f9feac87d87716f91c529429b579aa23d /src/services/note
parent[Client] Fix bug (diff)
downloadsharkey-6bbccedb2db040fb70ea0176e78bcb84daf9109e.tar.gz
sharkey-6bbccedb2db040fb70ea0176e78bcb84daf9109e.tar.bz2
sharkey-6bbccedb2db040fb70ea0176e78bcb84daf9109e.zip
[Server] Fix #3528
Diffstat (limited to 'src/services/note')
-rw-r--r--src/services/note/create.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/services/note/create.ts b/src/services/note/create.ts
index b5e5c4e49c..fbafe29107 100644
--- a/src/services/note/create.ts
+++ b/src/services/note/create.ts
@@ -369,6 +369,13 @@ async function publish(user: IUser, note: INote, noteObj: any, reply: INote, ren
// Publish event to myself's stream
publishHomeTimelineStream(note.userId, detailPackedNote);
publishHybridTimelineStream(note.userId, detailPackedNote);
+
+ if (note.visibility == 'specified') {
+ for (const u of visibleUsers) {
+ publishHomeTimelineStream(u._id, detailPackedNote);
+ publishHybridTimelineStream(u._id, detailPackedNote);
+ }
+ }
} else {
// Publish event to myself's stream
publishHomeTimelineStream(note.userId, noteObj);
@@ -526,7 +533,13 @@ async function publishToUserLists(note: INote, noteObj: any) {
});
for (const list of lists) {
- publishUserListStream(list._id, 'note', noteObj);
+ if (note.visibility == 'specified') {
+ if (note.visibleUserIds.some(id => id.equals(list.userId))) {
+ publishUserListStream(list._id, 'note', noteObj);
+ }
+ } else {
+ publishUserListStream(list._id, 'note', noteObj);
+ }
}
}